Jump to content

Inbox help.


dean7

Recommended Posts

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

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... :D

Link to comment
https://forums.phpfreaks.com/topic/158412-inbox-help/#findComment-835429
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.