View Full Version : Class help

07-26-2007, 12:47 PM
class site{
var $unread;
var $query;
var $userid2;
var $numit;
var $row;
var $message;
function eventmail() {
$this->query=mysql_query("SELECT * FROM `events` WHERE `toid` ='$this->userid2' AND `readornot` ='$this->unread'") or die("Error with event query" . mysql_error());

if($this->numit > 0)
$this->message= $this->row['message'];
if($this->message == "You Have New Mail") {
echo"<br><br><a href='inbox.php'>$message</a>";
}elseif ($this->message == "You Have been Warned!") {
echo"<br><br><a href='yourwarnings.php'>$message</a>";
}else {
echo"<br><br><a href='inventory.php'>$message</a>";
} // end of if
} // end of if
} // end of function
} //end of class

For some reason this is not working. I've checked that userid2 is carrying the right ID(10), and i've also checked in the database that there is an event for the ID 10. But for some reason it's not showing up the event message

EDIT: Oops, i wasn't putting $this->message XD

07-26-2007, 01:40 PM
Hi have you tested the connection to the DB.
Maybe test the query on its own to see if any data is being fetched.