Jump to content

database column activity script...need help


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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.