When i put in this code WHERE to='$username' won't work?
<?php
$connect = mysql_connect ("localhost","root","") or die (mysql_error());
mysql_select_db ("login4") or die (mysql_error());
session_start();
$_SESSION['username'];
$username = $_SESSION['username'];
$query = mysql_query("SELECT * FROM pm ORDER BY id DESC");
$message = '' ;
while ($row = mysql_fetch_array($query)){
$id = $row['id'];
$to = $row['to'];
$from = $row['from'];
$title = $row['title'];
$date = $row['date'];
$message .= "<tr><td><a href='viewpm.php?&id=".$id."'>".$title."</a><br /></td><td>".$date."<br /></td></tr>";
}
?>
<table width="100%">
<tr><td>Title</td><td>Date</td></tr>
<?php
print $message;
?>