Justtechjobs.com Find a programming school near you






Online Campus Both


php-general | 2001062

[PHP] totals from a mysql query From: Andras Kende (info <email protected>)
Date: 06/21/01

Hello,

I have a php page which pull data from myusql database...
I'm new to php so I looking for some advice ...
I have a field which contains numbers and needed to have them totaled after
the query below the table...

Database:
|text1|text2|total|
|some|tfdfd|100|
|string|adfa|250|
|made|tofd|150|

total should be : 100+250+150

Query:
{$aresult=mysql_query("select * from testdb ,$db);}
while($amyrow = mysql_fetch_array($aresult))
{
echo "<Tr><td>";
{echo $amyrow["text1"];}
echo "</td><td>";
{echo $amyrow["text2"];}
echo "</td>";
}
echo "</td></tr></table>";
echo "all together : total";

total is : 500

Thanks,

Andras Kende

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe <email protected>
For additional commands, e-mail: php-general-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>