pdo postgres database
Posted: Mon Aug 02, 2010 5:49 pm
I am using PHP version 5.3.32 and have followed the directions setting up the PDO drivers but I still get an error "could not find driver" when trying to connect. I can connect using pg_connect() so I know the the database is working correctly. Here is my code.
I looked at phpinfo() and I see the PDO, pdo_pgsql, and pgsql drivers. I have the following extensions set in my php.ini file and I have confirmed that I am using the correct ini file.
extension=php_pdo.dll
extension=php_pdo_pgsql.dll
Thanks for your help.
Code: Select all
$const = "pqsql:host=127.0.0.1 ; dbname=cornmaze ; user=James ; password=aaqdsz1";
try
{
$test = new pdo($const);
}
catch (Exception $e)
{
echo "Caught Message: " . $e->getMessage();
}
extension=php_pdo.dll
extension=php_pdo_pgsql.dll
Thanks for your help.