I am quite new to the PHP world. I have installed MAMP on my Mac. This is the code I have written to connect to MySQL:
<?php
// Connect to the database server
$dbcnx = @mysql_connect("localhost", "root", “root”);
if (!$dbcnx) {
echo( "<P>Unable to connect to the " .
"database server at this time.</P>" );
exit();
}
?>
MySQL has already started and is running. I am not sure why am I not able to connect.