 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
molespf
Joined: 16 Jul 2007 Posts: 1
|
Posted: Mon Jul 16, 2007 6:42 pm Post subject: Call to undefined method DB_Error::query() |
|
|
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 |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1048
|
Posted: Mon Jul 16, 2007 7:14 pm Post subject: |
|
|
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 |
|
 |
|
|
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
|
|