Page 1 of 1

database column activity script

Posted: Thu Feb 26, 2009 9:02 pm
by vonnero
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.

Re: database column activity script

Posted: Thu Feb 26, 2009 11:22 pm
by requinix
Somehow you're keeping track of whether a message has been read yet or not, right? Probably a field in the table.

To find the number of unread messages, make a SELECT COUNT(*) query that only selects messages which are unread.
To show the message, well, you have to know which message to show. If you want the first unread message then make a query to select the earliest/latest unread message.

Re: database column activity script

Posted: Fri Feb 27, 2009 3:58 pm
by vonnero
hi tasairis, thanks for the direction...... I am trying to use a simple message system for the community website... a simple form that inserts messages into a databse column..... how do I single out unread mails from the inserted messages?

I have never done a messaging system before..... please assist.... thanks