I ran into a problem with the new messages not working properly after I rewrote the code to myslqi. Everything worked before the change, but since, it won't show the image that I have when there is a new message. Not sure why, but here's the code:
Code: Select all
<?php
$i = 0;
$messageinfo = "SELECT pid FROM messages where pid='$_SESSION[userid]' AND readm = '1'";
$user_query = mysqli_query($db_conx, $messageinfo);
while ($row = mysqli_fetch_array($user_query, MYSQLI_ASSOC)) {
$i = $i + 1;
}
if($i > 0) {echo "<a href='messages.php?messages=1'><img src = 'images/newmail2.png' width='43' title = " . $i . "New></a>";
}
else{echo "<a href='messages.php?messages=1'><img src = 'images/nomail.png' width='43'></a>";
}
?>