ole90
07-26-2007, 11:47 AM
class site{
var $unread;
var $query;
var $userid2;
var $numit;
var $row;
var $message;
function eventmail() {
$this->unread="unread";
$this->query=mysql_query("SELECT * FROM `events` WHERE `toid` ='$this->userid2' AND `readornot` ='$this->unread'") or die("Error with event query" . mysql_error());
$this->numit=mysql_num_rows($this->query);
$this->row=mysql_fetch_array($this->query);
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
var $unread;
var $query;
var $userid2;
var $numit;
var $row;
var $message;
function eventmail() {
$this->unread="unread";
$this->query=mysql_query("SELECT * FROM `events` WHERE `toid` ='$this->userid2' AND `readornot` ='$this->unread'") or die("Error with event query" . mysql_error());
$this->numit=mysql_num_rows($this->query);
$this->row=mysql_fetch_array($this->query);
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