Adding values retrieved from a db
Posted: Tue Jun 20, 2006 5:44 pm
Hi,i would like to nkow how i can add the values recieved from a query. the query i use is
i want to add all the values from the values colums which i have already recieved like this:
Code: Select all
$sql = "SELECT * FROM `coffers` WHERE `username`='" . $payee . "' AND `payed`='N'";Code: Select all
while ($array = mysql_fetch_array($result)) {
echo '<br>';
echo '<table width="200" border="1" cellspacing="7" cellpadding="7">';
echo '<th>Offer Name</th>';
echo '<th>Completed By</th>';
echo '<th>Offer Value</th>';
while($array = mysql_fetch_array($result,MYSQL_ASSOC)) {
echo '<tr>';
echo '<td>' .$array['offer_name']. '</td>';
echo '<td>' .$array['username']. '</td>';
echo '<td>$' .$array['value']. '</td>';
}