Ok, I made a messaging system for my site and everything works and i was just about to add a code where it will tell you when you have new mail. I created a row in my database called 'read' and when they read it the value will be when and if they dont it will be 0. Whenever they read it, it should update from 0 to 1, but it isn't working. I have connected to my database its just farther up in the code and you only need this one part. Thanks alot for your help!
} elseif ($_GET['area']=='readmail') {
$id=$_GET['id'];
$query=mysql_query("SELECT * FROM messaging WHERE id='$id' AND receiver='$username'");
$row=mysql_fetch_array($query);
$message=$row['message'];
$message=strip_tags($message);
$update=mysql_query("UPDATE messaging SET read='1' WHERE id='$id'");
echo ("<table border=1 cellpadding=0 cellspacing=0 height=200 width=500>");
echo ("<tr height=25><td align=left>From: ".$row['from']."</td><td> Subject: ".$row['subject']."</td></tr>");
echo ("<tr height=150><td align=left valign='top' colspan=2>".parsecode($message)."</td></tr>");
echo ("<tr height=25><td colspan=2 align=left><a href='/messaging.php?area=compose&to=".$row['from']."&subject=".$row['subject']."'>Reply</a>
- <a href='messaging.php?action=delete&id=$row[id]'>Delete</a></table>");