Before you start diving into the world of SQL, just a short note about commenting your SQL code. In SQL, there are a number of ways to comment your code, of which the most popular are /* */ and #, both of which are seen in PHP. Of the two, # is more popular - like PHP, it comments to the end of the line.
Author's Note: I personally find # good for SQL because I never use it in PHP scripts - it makes the distinct between complex SQL queries and PHP code that little bit more obvious. Choose what fits you best.
Copyright 2012 Future Publishing Limited (company
registered number 2008885), a company registered
in England and Wales whose registered office is at