mark read/unread message in php
hi, i am developing messaging system in php. i am able to retrieve messages stored in mysql but not able to mark unread message in bold
this code will retrive data from mysql table and display result in table format.
I want unread message to be shown in bold letter and read message in normal text.
In my table i have msg_read column which is set to '0' if message is unread and '1' if message is already read by user.
echo "<table border='1' cellpadding='10'>";
echo "<tr><th>From</th> <th>Subject</th> <th>Date</th></tr>";
// loop through results of database query, displaying them in the table
while($row = mysqli_fetch_array($selectresult))
{
// echo out the contents of each row into a table
echo "<tr style=''>";
echo '<td>' . $row['from_user'] . '</td>';
echo '<td>' . $row['message_title'] . '</td>';
echo '<td>' . $row['date'] . '</td>';
echo '<td><a href="?page_id=1174&MI=' . $row['message_id'] . '">Read</a> </td>';
echo '<td><a href="?page_id=1301&MI=' . $row['message_id'] . '">Delete</a> </td>';
echo "</tr>";
}
// close table>
echo "</table>";
Please if someone can help Thank You.
|