Jump to content

[SOLVED] Not sure on how to do this, making a total


Lamez

Recommended Posts

ok now I am working on my PM system, and I cannot figure out how to total up the unread messages.

 

My DB:

sender, receiver, received, message, subject

 

so when the user logs in I want them to see how many unreceived messages they have.

 

so something like this?

 

<?php
$r = mysql_query("SELECT * FROM `messages` WHERE `receiver`='$user_' AND `received`='0'");
$total = mysql_num_rows($r);

echo $total;
?>

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.