php - Calculating total -


i'm looking on calculating total lots of subtotals database, code i'm using working calculate it, php echos error saying

notice: undefined variable: tot in ..............\viewing.php on line 192

but still calculating total cost , echoing it, ideas on how rid of error?

i getting subtotals database using this:

while($row=mysql_fetch_array($result)) {  echo ..... $tot += $row['subtotal']; } 

at bottom of page, i've made shows total , working, still giving me error saying variable tot undefined, ideas?

it isn't error, it's notice!

initialise

$tot = 0; 

before while loop


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -