I'm trying to add 'NEW' to unread messages in the inbox. I don't think I can use an if statement within an echo and I have tried and failed to understand the proper use of ternary operators. I would appreciate any help. Thanks a lot.
If read_yet = 'no' I want to add this code as another echo statement:
echo '<td>NEW</td>' ;
Here is my current code for the inbox.
$sql = mysqli_query($con, "select * from messages
WHERE deleted = 'no' AND to_user = '" . $_GET['username'] . "'
ORDER BY id DESC");
while ($row = mysqli_fetch_array($sql)){
echo '<tr>';
echo '<td><a href="profile.php?username=' ;
echo $row['from_user'] ;
echo '">';
echo '<img id="usersimage" src="images/profileimg/thumbnail_'.$row['from_user'];
echo '.jpg"</a></td>' ;
echo '<td><a href="users.php?username=' ;
echo $row['from_user'] ;
echo '">';
echo $row['from_user'];
echo "</a></td><td><a href='messageid.php?id=".$row['id']."'><font color='#b2ccdb'>" .$row['subject'] ;
echo '</a></font></td>';
echo '</tr>';
}