I'm looking for some help on calculating a total from lots of subtotals from a database, the code I'm using is working to calculate it, but the PHP echos an error saying that
Notice: Undefined variable: tot in ..............\viewing.php on line 192
But it is still calculating the total cost and echoing it, any ideas on how to get rid of that error?
I am getting the subtotals from a database using this:
while($row=mysql_fetch_array($result)) {
echo .....
$tot += $row['subtotal'];
}
At the bottom of the page, I've made it so it shows the total and its working, but its still giving me an error saying that the variable tot is undefined, any ideas?