J
Justin Voelker
I have built a php website with a messaging system where users of a
website can send messages to each other and they will appear in the
other users inbox for viewing next time they log in. In a bar at the
top of the page it says "Inbox (0)" if they have no new messages and,
yup, you guessed it "Inbox (2)" if they have two waiting messages. If
someone sends them a message while they are sitting on some page of
the website I would like the counter to increase. Each time someone
sends a message it creates a new record in a single table in the
database. What I am looking for is a way to monitor that database and
find any records with "msg_to" equal to the user id of the person
logged in and "msg_unread" equal to '1.' Right now the mysql query
runs each time a page is loaded so they would be notified then but I
would like it to somehow update the inbox number while they sit on a
page. Does anyone have any ideas? I was told in the comp.lang.php
group that AJAX might be able to help and that I should check this
group. Thank you in advance for your help!
website can send messages to each other and they will appear in the
other users inbox for viewing next time they log in. In a bar at the
top of the page it says "Inbox (0)" if they have no new messages and,
yup, you guessed it "Inbox (2)" if they have two waiting messages. If
someone sends them a message while they are sitting on some page of
the website I would like the counter to increase. Each time someone
sends a message it creates a new record in a single table in the
database. What I am looking for is a way to monitor that database and
find any records with "msg_to" equal to the user id of the person
logged in and "msg_unread" equal to '1.' Right now the mysql query
runs each time a page is loaded so they would be notified then but I
would like it to somehow update the inbox number while they sit on a
page. Does anyone have any ideas? I was told in the comp.lang.php
group that AJAX might be able to help and that I should check this
group. Thank you in advance for your help!