NOW I'm missing something basic
From:
Martin <chimbis@bahnhof.se>
Date:
Sunday 04 November 2001 08.09.21
Groups:
php.pear.general
no references
I'm trying to get
function exists($name)
{
$sql = "SELECT * FROM users WHERE (name='$name')";
$res = $db->query($sql);
if (DB::isError($res)) {
die ($res->getMessage());
}
if($res)
{
$Rows = $res->numRows();
if($Rows > 0)
{
return(TRUE);
} else
{
return(FALSE);
}
}
To return something useful (below if($Rows > 0)). It doesn't.
I have
require_once("DB.php");
$dsn=""mysql://$cfg_dbuser:$cfg_dbpasswd@$cfg_dbhost/$cfg_dbname";
in the code and this apparently works.
Now: $res = $db->query($sql);
doesn't seem to do anything. After some time :-/ researching this I found
that query isn't in DB.php but DB/common.php. So do I include that file
somewhere? If I try I get:
Fatal error: Class db_common: Cannot inherit from undefined class pear in
/usr/local/lib/php4/pear/DB/common.php on line 30