Jump to content

Call to a member function on a non-object


adam84

Recommended Posts

I got this stupid error message: Call to a member function on a non-object. any ideas?

 

<?
include("include/info.php");

$link = ~~~~~~~~~~
mysql_select_db (~~~); 

$email = $_GET['email'];
$name= $_GET['name'];

$query = "SELECT * FROM users WHERE userEmailPrim = '$email' AND userName= '$name'";
$r = mysql_query( $query, $link );
if( mysql_num_rows( $r ) > 0){
	$row = mysql_fetch_row( $r );
	$info->userInformation( $row[0] );   <---- error occurs here
}
else
	echo "user not found";

?>

 

<?

class info{
   var $userid;

   function info(){
     $this->$userid = -1;
   }

   function userInformation($userID){
      $this->userid = $userID;
   }

}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.