Not sure if you MYSQL is installed correctly..
Try this simple connection string...
Also check out phpinfo() to see if you registered MYSQL correctly.
Remember PHP 5.x does NOT include support for MYSQL.
Below is a simple php script to test your installation. Change your credentials accordingly. Code ONLY here.
<?php
// hostname or ip of server (for local testing, localhost should work)
$dbServer='localhost';
// username and password to log onto db server
$dbUser='root';
$dbPass='';
// name of database
$dbName='test';
$link = mysql_connect("$dbServer", "$dbUser", "$dbPass") or die("Could not connect");
print "Connected successfully<br>";
mysql_select_db("$dbName") or die("Could not select database");
print "Database selected successfully<br>";
// close connection
mysql_close($link);
?>