Cannot instantiate non-existent class: pdo in....
Posted: Mon Nov 09, 2009 12:37 pm
Hi there,
I'm a newbie to php and have been working my way through some tutorials however I'm coming up with the following error:
Cannot instantiate non-existent class: pdo in...
The line I'm pointed to contains this:
Which is preceeded by this:
This include file contains this code:
I've been able to test a connection to the database using this:
And, that works fine and a connection is made.
Please can someone point me in the right direction.
I'm replacing the xxx, yyy and zzz with the database name, username and password.
Thanks in advance.
Regards,
Nick
I'm a newbie to php and have been working my way through some tutorials however I'm coming up with the following error:
Cannot instantiate non-existent class: pdo in...
The line I'm pointed to contains this:
Code: Select all
$db = new PDO(DB_INFO, DB_USER, DB_PASS);Code: Select all
include_once 'db.inc.php';Code: Select all
<?php
define('DB_INFO', 'xxx');
define('DB_USER', 'yyy');
define('DB_PASS', 'zzz');
?>Code: Select all
<?php
$link = mysql_connect('xxx', 'yyy', 'zzz');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>Please can someone point me in the right direction.
I'm replacing the xxx, yyy and zzz with the database name, username and password.
Thanks in advance.
Regards,
Nick