i have a while loop that returns some values:
while ($get_keywords3 = mysql_fetch_array($keywords2)){
?>
<tr>
<td><span style="margin: 0 3px;"><?php echo $get_keywords3['grand_total'];?></span></td>
</tr>
<?php }
this returns back:
123
234
345
456
...
what i want is to add those together: 123 + 234 + 345 + ...
any ideas?
thanks
Either make a separate variable and do the sum in the while book (
$var += $get_keywords3['grand_total'];) or make the sum in your query if you only want to sum (SELECT SUM(grand_total) -- etc).