Page 1 of 1

Weird error

Posted: Mon Aug 29, 2005 2:59 pm
by influx

Code: Select all

function email_checker($tess)
{
   $name_check = $db_object->query("SELECT m_email FROM mail_list WHERE m_username = '{$_SESSION['username']}' AND m_email = '$tess'");
   $name_checkk = $name_check->numRows();
   if ($name_checkk != 0) //if number of rows isn't 0, there obviously is already a row with that same username
   {
       return false;
   }
}
What could be wrong with this code? I get the following error:

Fatal error: Call to a member function on a non-object in /var/www/website.com/test.php on line 206 (the first line in the function after the opening { bracket)

Posted: Mon Aug 29, 2005 3:49 pm
by neophyte
Insert after function blah($tes):

Code: Select all

global $db_object;
That should do it.