database column activity script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vonnero
Forum Newbie
Posts: 17
Joined: Tue Feb 17, 2009 6:19 am

database column activity script

Post 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.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: database column activity script

Post 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.
vonnero
Forum Newbie
Posts: 17
Joined: Tue Feb 17, 2009 6:19 am

Re: database column activity script

Post 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
Post Reply