DB error: $db->query('SELECT 1+1') called in function is thorwing error
| From: | l Burnerheimerton | Date: | Fri, 19 Aug 2005 17:37:04 +0000 |
| Subject: | DB error: $db->query('SELECT 1+1') called in function is thorwing error | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-20490@lists.php.net to get a copy of this message | ||
I have code that calls a function. In that function,
I have labored several hours trying to see WHY it's
throwing an error. I'd like a second, or third pair
of eyes to help. I have narrowed it down to its
essential, I think, a very simple example.
The error is:
Fatal error: Call to a member function on a non-object
in C:\...\check.php line 34
I show line 34 of the function below. I tried to make
a simple sql call but it still throws error. I have
tried it with and without calling DB.php and
connect.php, no difference.
Any help is much appreciated!
The main page snippet:
<?php
require_once("DB.php");
require_once("connect.php");
require_once("check.php"); // page containing the
function
$ID = id_check();
?>
Here's the check.php snippet:
<?php
require_once("DB.php");
require_once("connect.php");
...
$resSEC = $db->query('SELECT 1+1'); //line 34
...
?>
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs