If you have any idea what is a SELECT query, then I have already given a nudge in the right direction.
I just wanted you to ensure that you know what was happening, and so you should read the docs.
php.net wont work here.
You need info on databases, so try say mysql.com