PDA

View Full Version : Fatal error: Call to a member function help


Acers
05-29-2005, 01:56 AM
was trying to get some page into the who's online system. was doing pattern recognition. the code is like :


elseif (preg_match("/topic\/(\d*)-\d*/", $userinfo['location'], $tester1))
{

$titlethrd = $DB_site->query("
SELECT title
FROM " . TABLE_PREFIX . "thread
WHERE threadid = " . intval($tester1[1]) . "
");


$userinfo['where'] = "<a href=\"search/topic/$tempo-1.html\"\">$titlethrd[title]</a>";


}


idea being that if there is a match then in $tester1[1] i will have the thread id(which i do have , i have checked via echo. Now on the line
$titlethrd = $DB_site->query("

i am getting
Fatal error: Call to a member function on a non-object

what does that mean?

filburt1
05-29-2005, 02:22 AM
Add:

global $DB_site;

...to the beginning of your function.

Acers
05-29-2005, 03:39 AM
k that did it..
thanks