Hi there,
First of all, I'm really enjoying your book until now. It has been very helpful.
The only problem is: I'm using MySQL and not PostgreSQL. It's not a problem with the queries, the only problem is with the _getConnection() method.
In order to connect to a PostgreSQL database, you only need to use the pg_connect() function, and then simply return it.
But when using MySQL, you need to first use the mysql_connect() function, and then mysql_select_db(). The mysql_connect() function is the one should be returned.
I thought about something like this:
PHP Code:
private static function _getConnection()
{
static $hDB;
if (isset($hDB))
return $hDB;
$hDB = mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("wrox_contactmanager", $hDB) or die(mysql_error());
return $hDB;
}
Is that okay?