Jump to content

database column activity script...need help


vonnero

Recommended Posts

I have deleoped a cumminity website.... I am trying to create a script that will notify users as soon as they recieve a message and also show the number of messages unread.

 

I am using mysql INSERT INTO to insert the message to the email table... I am not sure how to show users how many unread messages waiting for the... or how to show unread messages....

 

any assistance at this time will be a life saver.... or online tutorials....

 

Thanks in advance.

I have a rough idea what you mean, would help if you posted the code though.

 

You could use mysql_num_rows when you select all of one persons unread mail, so they have 3 mail unread it'll return 3, then use that for the notification, say -

 

$NumReturn=mysql_num_rows($QUERY);

echo "You have ";
echo $NumReturn;
echo " unread messages!";

 

The query would be selecting all from table(table being a user's mail) where $SomeVariable=1 (1 being unread).

 

I could be completely wrong, only started learning PHP/MySQL about a week ago, but I think that could work..

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.