adam84 Posted March 12, 2007 Share Posted March 12, 2007 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; } } ?> Quote Link to comment Share on other sites More sharing options...
vbnullchar Posted March 12, 2007 Share Posted March 12, 2007 you didnt initialize the class $info=new info(); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.