dean7 Posted May 16, 2009 Share Posted May 16, 2009 Hi all, on my website ive got a thing that says when someone has got a message This is my code <?php include('config.php'); $get = mysql_query("SELECT * from pmessages where touser = '$logged[username]' order by id desc");$nummessages = mysql_num_rows($get); if ($nummessages == 0) { echo (""); } else { if ($nummessages == 1); $markread = mysql_query("update pmessages set unread='read' where id < '$_GET[msgid]'"); echo ("You Have A Message"); } // main one ?> When the person has read the message i would like it so it wont say that person still has a message, but when they have read the message it still shows it . Anyone know how i can stop that? Thanks for you help Link to comment https://forums.phpfreaks.com/topic/158412-inbox-help/ Share on other sites More sharing options...
Ken2k7 Posted May 16, 2009 Share Posted May 16, 2009 Well, you'll want to edit this in the PHP that handles displaying the PM message. When the user opens the PM (I assume via URL), you can get the PM id number and update the DB from there. Also, make sure you do the same if the user deletes the message without reading it. That still counts as a read message... Link to comment https://forums.phpfreaks.com/topic/158412-inbox-help/#findComment-835429 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.