I finally decided to take a look at PDO, and I can’t even connect to my database. This is my original connection (though I’ve changed the values, of course)…
$link = mysql_connect ("localhost" , "Money" , "XYZ") or die(mysql_error());
mysql_select_db ("db_horse", $link) or die(mysql_error());
And this is how I translated it for PDO…
try {
$conn = new PDO('mysql:host=localhost;dbname=db_horse', $Money, $XYZ);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch(PDOException $e) {
echo 'ERROR: ' . $e->getMessage();
}
But I get this error message:
ERROR: SQLSTATE[42000] [1044] Access denied for user ‘’@‘localhost’ to database ‘db_horse’
I have PHP version 5.3.6 on a Mac, using MAMP Pro.
Thanks.