I have this code:
<?php
session_start();
include 'db.php';
$username = $_SESSION['username'];
$query = "SELECT * FROM mail WHERE touser= '$username'";
$result = mysql_query($query);
while($row=mysql_fetch_assoc($result)){
$results[]=$row;
}
//now, assuming that each row in $results has these values --> id, fromuser, sub
?>
<style type="text/css">
<!--
.style1 {font-family: Tahoma}
-->
</style>
<table width=74% align="center" border="1" bordercolor=#111111 style="border-collapse:collapse">
<tr class="style1">
<td width="33%" align=center bgcolor=#FFFFFF><span class="style1"><font face='Tahoma'>From</span></td>
<td width="67%" align=center bgcolor=#FFFFFF><span class="style1"><font face='Tahoma'>Subject</span></td>
</tr>
<?php
foreach($results as $key => $value){
echo "<tr>";
echo "<td><a href=\"CMail.php\">".$value['fromuser']."</a></td>";
echo "<td>".$value['sub']."</td>";
echo "</tr>";
}
?>
and it works, but i want to set the value of sub to a simple session variable firstly. Secondly, here s the massive problem, how do i separate these rows into individual bits of data cos atm when i echo the values its a long list. This page is an inbox of a mailing system. it shows the person its from in one column, and the subject in the next. When you click on the subject text, i want it to open a new page with the message from the user. how do i do this? Thanx