Page 1 of 1

need some help

Posted: Mon Dec 22, 2008 2:43 am
by sadimr9
Hello I'm new on php.

I've developed an e-commerce script by my self. but I've some problem on counting total value of my multiple rows. I'm explaining here...

cart.php

item name ................| qyt |....price |.... total |
----------------------------------------------------------------
some item .................. 4 ...... $12.00 .... $48.00
some item .................. 3 ...... $10.00 .... $30.00
some item .................. 1 ...... $43.20 .... $43.20
----------------------------------------------------------------
........................................ Sub Total : $00.00 *
..............................................Total : $00.00 *


I've done with (do while loop) to show the record from mysql, but I can't show the total amount on sub total...

I know it's very little code, but this time my brain failed to find that, so can any one help me to solve that issue.

best regards
Sadi Chowdhury

Re: need some help

Posted: Mon Dec 22, 2008 3:13 am
by pcoder
Have you tried any technique to show the sub total?

Re: need some help

Posted: Mon Dec 22, 2008 3:43 am
by sadimr9
Hello dear,

I've tried to show to the sub total value with [ mysql_query="select * SUM(price) from table" ]

but it show me more digit. like $23.23'123434534

but I need $45.34 as well.

best regards

Re: need some help

Posted: Mon Dec 22, 2008 3:45 am
by pcoder
To get the rounded value you can use round on PHP.
Cheers