It seems that the way that you are making the call with $db->quote('...')
would indicate that there is a class that has the function "quote()" defined
within. I would venture to guess that either:
a) That class doesn't really have that function defined within it
or
b) you are not calling that function properly aka you may not have
instantiated the class improperly.
Michael R. Bright
----- Original Message -----
From: "Daniel Crookston" <[EMAIL PROTECTED]>
To: "BYU Unix Users Group" <[EMAIL PROTECTED]>
Sent: Thursday, September 18, 2003 4:57 PM
Subject: [uug] X-post PHP question
> 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
>
____________________
BYU Unix Users Group
http://uug.byu.edu/
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list