Problem with PEAR DB & MySQLi
| From: | Rodolfo Gonzalez Gonzalez | Date: | Mon, 26 Jul 2004 17:18:37 +0000 |
| Subject: | Problem with PEAR DB & MySQLi | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-191895@lists.php.net to get a copy of this message | ||
Hi,
I'm trying to use PEAR's DB class with the new PHP 5 MySQLi support on
MySQL 4.1.3, using this example from the PEAR's docs (with my parameters
of course). I'm getting "DB unknown error" messages after the query. The
same query from the mysql client works fine, there are no connection
problems... anyone has tried PEAR with mysqli?.
<?php
// Create a valid DB object named $db
// at the beginning of your program...
require_once 'DB.php';
$db =& DB::connect('mysqli://prueba:clave@127.0.0.1:3306/mibase');
if (DB::isError($db)) {
die($db->getMessage());
}
// Proceed with a query...
$res =& $db->query('SELECT * FROM users');
// Always check that result is not an error
if (DB::isError($res)) {
die($res->getMessage());
}
?>
result:
DB Error: unknown error
Regards,
Rodolfo.