What is wrong with this small piece of code?!
PHP Code:<?php
$sql = "SELECT variable1, variable2, variable3, variable4, variable5, (variable1 + variable2 + variable3 + variable4 + variable5) AS total FROM table";
$result = mysql_query($sql); $total = 0;
while ($row = mysql_fetch_array($result)) {
$total += $row['variable1 + variable2 + variable3 + variable4 + variable5'];
}
echo "Total: " . $total;
or die("INSERT Error: ".mysql_error());
;
?>






Someone above even linked to the documentation.



Bookmarks