graham23s Posted August 6, 2007 Share Posted August 6, 2007 Hi Guys, currently in my script if the user has a private message the inbox word turns red, but what i wanted to do was turn it blue if messages were unread i tried this: <tr> <td colspan="3" align="center" width="100%" height="25"> <div id="links"> <a href="my_account.php">My Account</a> | <?php // Get the users details from mysql...////////////////////////////////////////////// $query_1 = "SELECT * FROM `membership` WHERE `username`='$member'"; $result_1 = mysql_query($query_1) or die (mysql_error()); $row = mysql_fetch_array($result_1); $id = $row['id']; $username = $row['username']; $email = $row['email']; $country = $row['country']; $avatar = $row['avatar']; // check if the user has messages in there inbox...///////////////////////////////// $query_msg = "SELECT * FROM `pms` WHERE `reciever_id`='$id'"; $result_msg = mysql_query($query_msg) or die (mysql_error()); $how_many = mysql_num_rows($result_msg); $read = $rows['read_flag']; if (mysql_num_rows($result_msg) > 0) { echo '<a href="inbox.php"><font color="red">Inbox</font></a> | '; } elseif ($read == 'N') { echo '<a href="inbox.php"><font color="blue">Inbox</font></a> | '; } else { echo '<a href="inbox.php">Inbox</a> | '; } ?> <a href="search.php">Search</a> | <a href="scene_reviews.php">1337 Reviews</a> | <a href="browse_nzb.php">Browse NZB's</a> | <a href="userlist.php">Users</a> | <a href="forums.php">Forums</a> | <a href="upload_nzb.php">Upload NZB</a> | <a href="trailers.php">Trailers</a> | <a href="requests.php">Requests</a> | <a href="contact_staff.php">Contact</a> | <a href="top_ten.php">Top 10</a> | <a href="faq.php">FAQ</a> </div> </td> </tr> <tr> <td colspan="2" bgcolor="#F8F7F1" height="100%" align="center" valign="top" id="content"> but i know i really need to do a while loop somewhere to see if there is unread messages but am stuck as to where lol any help would be great cheers Graham Quote Link to comment https://forums.phpfreaks.com/topic/63609-private-messaging-code/ Share on other sites More sharing options...
Fadion Posted August 7, 2007 Share Posted August 7, 2007 $read = $rows['read_flag']; U have no $rows assigned to a mysql_fetch_array(). Quote Link to comment https://forums.phpfreaks.com/topic/63609-private-messaging-code/#findComment-317123 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.