PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Call to undefined method DB_Error::query()

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> PEAR
View previous topic :: View next topic  
Author Message
molespf



Joined: 16 Jul 2007
Posts: 1

PostPosted: Mon Jul 16, 2007 6:42 pm    Post subject: Call to undefined method DB_Error::query() Reply with quote

I'm getting the following error on my website. It was built by someone else and has been working until I needed to move it to a new server. Now it's broke.
Code:
Fatal error: Call to undefined method DB_Error::query() in [file location]/browse.php on line 41


on line 41 I have:
Code:
$countR = $db->query($sql);


I made sure that the DB folder and db.php were both in my php_include path.

Any thoughts?
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1235

PostPosted: Mon Jul 16, 2007 7:14 pm    Post subject: Reply with quote

Is "db.php" a typo? On Unix systems, the case of the filenames is important, i.e. DB.php is the right filename. On Windows, db.php will also work.

What do you mean by db.php is your include_path? This setting is only for directories.

And the include_path shouldn't include the DB/ directory, but its parent directory.

Finally, you should always check the created $db object, e.g.:
Code:

$db =& DB::connect(...);
if (PEAR::isError($db)) {
    die($db->getMessage()  . ', ' . $db->getDebugInfo());
}


This error handling (not for production use in this notation, of course) should tell you more about the error, if the other hints didn't help you.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> PEAR All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement