MyBB Hacks

Full Version: Help to do sum the columns of a row (field's of a record)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Please help me to do the sum of the columns of a row : php mysql

The codes are below but I am not getting any result.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>salary222</title>
</head>

<body>


<?php
include connectsl.php;<--database connection -->
$sum=0;
$r = mysql_query('SELECT basic+houserent+increment+medical+children+convence+washing+superanfund1+personalpay+entertainment+
faculty+chairman+domestic+hill+others+exgratia FROM salary');

while ($row = mysql_fetch_array($r))
{
print $sum += $row[0];
}
?>


</body>

</html>
Too many things could be the issue to give you an answer.
Reference URL's