Hey VG,
Upon first glance, I would suggest you try a lot less code for your initial run. A simple echo of "blah, blah" would suffice after you open the connection to the database.
I'm not real familiar with this specific error, but it sounds like it can't find the db. Here are some questions I have:Is the database name really mysql? [If so, you might want to consider renaming it]
Is the db on this same machine or on the net? [If on another machine, your connection needs the address]
Also, I remember having to load the PHP and MySQL application files in the root of the machine. [i.e. - not in a subdirectory] So, maybe you want to check that out too.
Best of luck - you're doing good so far!