This is a cross-post with the Utah PHP User's Group mailing list.  I
apologize to all who are going to see it twice.  I'll buy you Krispy Kremes
if you get mad enough =)

Hi all.  I've got some code that I'm working on that someone else developed,
and it's calling a method that doesn't exist:

Fatal error: Call to undefined function: quote() in
/usr/local/etc/httpd/htdocs/deafculture/library/user.php on line 109

The line in question:

$sql = sprintf('select count(*) from users where username=%s',
$db->quote($username));
$t = $db->getOne($sql);

Okay that's two lines, but getOne doesn't exist in the object $db either.
Here's where $db gets created:

function &dbref() {
    global $db;
    if(!isset($db)) {
        global $DSN;
        $db = @DB::connect($DSN, true);
    }
    return $db;
}

So, I'm not an expert at OO stuff.  In fact, I've tried not to learn it for
a long time.  Looks like I get to now.  Near as I can tell, the file DB.php
(which, also as near as I can tell, is a file that's included by default in
recent versions of PHP) should have the functions quote and getOne defined
in it.  Well, surprise surprise, it doesn't.

I *suspect* (though I'm probably way off) that what's going on is that the
author of the code was developing it with a newer version of DB.php than the
one I'm using, so if I just update DB.php (and possibly PEAR.php too) then
everything should work fine.  I'm really not sure how to do that though, if
that's even what I want to do.  I've looked over pear.php.net and whatnot,
but I don't see anything there that's been helpful - or rather, I probably
have, but I didn't know that I was looking at what I wanted :-)  Could
someone point me in the right direction?
Thanks,
Daniel


____________________
BYU Unix Users Group 
http://uug.byu.edu/ 
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to