here is my code for message i want to show message with avatar .i'm unable to create it
any one help me for displaying message with avatar
my message system
<?php
require "database.php";
$userfinal=$_SESSION['MM_Username'];
// get the messages from the table.
$get_messages = mysql_query("SELECT message_id FROM messages WHERE to_user='$userfinal' ORDER BY message_id DESC") or die(mysql_error());
$get_messages2 = mysql_query("SELECT * FROM messages WHERE to_user='$userfinal' ORDER BY message_id DESC") or die(mysql_error());
$num_messages = mysql_num_rows($get_messages);
// display each message title, with a link to their content
for($count = 1; $count <= $num_messages; $count++)
{
$row = mysql_fetch_array($get_messages2);
//if the message is not read, show "(new)" after the title, else, just show the title.
if($row['message_read'] == 0)
{
echo'<hr color="#007FAA">';
echo $row['from_user']. '<br>';
echo $row['message_contents'] . '</a><br>
<br>';
}else{
echo '<a href="read_message.php?messageid=' . $row['message_id'] . '">' . $row['message_title'] . '</a><br>';
}}
echo '<form name="backfrm" method="post" action="inbox.php">';
echo '<input type="submit" value="Back to Home">';
echo '</form>';
?>
using this code for my avatar display
<?php
require("connect.php");
$username=$_SESSION['MM_Username'];
$query=mysql_query("SELECT *FROM members WHERE username='$username'");
if(mysql_num_rows($query)==0)
die("User not found!!!!");
else
{
$row=mysql_fetch_assoc($query);
$location=$row['avatar'];
echo "<img src='$location' width='100' height='100'>";
}
?>