Jump to content

php maths problem


otuatail

Recommended Posts

Hi

I have adb field

`Cost` decimal(4,2) NOT NULL default '0.00'

 

I want to iterate through the table put data into a <table>

What i have is this but it dosn't work.

 

$totals = (float)"0.00";
while ($row = mysql_fetch_array($rs))
{
  $totals .= (float)$row["Cost"];
}
echo (float)$totals;

Can't figure this addition.

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/189326-php-maths-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.