I am trying to output my data but at the same time total a column for output which will be sorted by date. I have tried to do multiple select statements to no avail. below is my code with my data outputted but i cannot get it to total my column and output that as well. PLEASE HELP I AM A SELF TAUGHT NEWBIE
$table = "test";
mysql_connect($db_host, $db_user, $db_pwd);
mysql_select_db($db_name)or die( "Unable to select database");
$query="SELECT * FROM $table";
$result=mysql_query($query);
$num=mysql_numrows($result);
$i=0;
while ($i < $num) {
$date=mysql_result($result,$i,"date");
$food=mysql_result($result,$i,"food");
$points=mysql_result($result,$i,"points");
?>
<tr>
<td><font face="Arial, Helvetica, sans-serif"><? echo $date; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><? echo $food; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><? echo $points; ?></font></td>
</tr>
<?
$i++;
}
echo "</table>";
?>