Help to do sum the columns of a row (field's of a record)
noyeem Offline
Junior Member
**
Posts: 1
Joined: Nov 2012
Post: #1
Help to do sum the columns of a row (field's of a record)
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>
(This post was last modified: 11-06-2012 07:17 PM by noyeem.)
11-06-2012 07:13 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Online
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: Help to do sum the columns of a row (field's of a record)
Too many things could be the issue to give you an answer.

My Blog
11-07-2012 10:28 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: