install problem with the DB package
| From: | Gareth Gibson | Date: | Thu, 24 Jul 2003 14:24:30 +0000 |
| Subject: | install problem with the DB package | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-6790@lists.php.net to get a copy of this message | ||
I have a new PEAR installation , and I am testing the DB package.
Here is my test code, it runs OK until the fetchRo command....
<?php
// The pear base directory must be in your include_path
require_once 'DB.php';
$user = 'admin';
$pass = 'admin';
$host = 'localhost';
$db_name = 'clients_db';
// Data Source Name: This is the universal connection string
$dsn = "mysql://$user:$pass@$host/$db_name";
$db = DB::connect($dsn, true);
if (DB::isError($db)) {
die ($db->getMessage());
}
$sql = "SELECT * FROM mydatabase";
$rs = $db->query($sql);
$row = $rs->fetchRow();
print $row[0];
// You can disconnect from the database with:
$db->disconnect();
?>
And then I get the following error:
Fatal error: Call to undefined function: fetchrow() in
C:\webserver\peartest.php on line 20
I don't understand how it can be getting this far, and then crashing? Does
anyone have any ideas?
Cheers
Gareth.