Trying to extract and echo out the Total Value of Prices in a Database relating to a User.
The code below is only echoing out the last row entry for a given user....
$str_SQL = "SELECT * FROM basket WHERE user = '".$_SESSION['thisuser']."'";
$resulttotal = $db->query_db('mydb',$str_SQL);
if(mysql_num_rows($resulttotal)>0)
{
while($rows = mysql_fetch_array($resulttotal))
{
$theprice=$rows['price'];
$totalprice=$theprice;
}
}
echo ''.$currencysymbol.' '.$totalprice.'<br>';
Any Help appreciated, it's driving me nuts...