I have this PHP code:
$query = "SELECT name, COUNT(message) FROM guestbook_message WHERE name='".$req_user_info['username']."' GROUP BY name";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result))
{
echo "Messages posted: ". $row['COUNT(message)'] ."";
echo "<br />";
}
Which will show the amount of comments a user has posted.
How do I make it return a value if there is no messages posted from that user? Currently is displays nothing at all. But I want it to show "Messages posted: 0"
Any ideas?