im trying a simple database tutorial, and i can't make contact to the database, I get this warning:
Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) in /Applications/xampp/xamppfiles/htdocs/test/- on line 22 Could not connect to database
my database.php is in /Applications/xampp/xamppfiles/htdocs/test/
and the php script connecting to the database is:
// Connect to MySQL
if ( !( $database = mysql_connect( "localhost",
"httpd", "" ) ) )
die( "Could not connect to database" );
// open Products database
if ( !mysql_select_db( "Products", $database ) )
die( "Could not open Products database" );
what am I doing wrong :S