Simple but silly :-) - Please Help :-)
Posted: Thu Jun 04, 2009 5:24 pm
Hi, i'm new to this site and pretty new to PHP and I have a really simple but silly question for everyone.
Basically, at the moment I'm trying to return the total sum of a price column from a database I have. I've built my own shopping cart as a side project and would like to know how to add the total values of the cart for that user together.
Here's what I have so far...
How do I add the result of all the prices together to get a total cost for the user?
Sorry, probably seems a simple thing but I've looked all over google and it might as well be in spanish to me lol
Thanks in Advance.
Netties
Basically, at the moment I'm trying to return the total sum of a price column from a database I have. I've built my own shopping cart as a side project and would like to know how to add the total values of the cart for that user together.
Here's what I have so far...
Code: Select all
$query2="SELECT * FROM orders_temp WHERE order_username = '" . $_SESSION["user_name"] . "'";
$result2=mysql_query($query2);
while($r1=mysql_fetch_array($result2))
{
$order_product_price=$r1["order_product_price"];
}Sorry, probably seems a simple thing but I've looked all over google and it might as well be in spanish to me lol
Thanks in Advance.
Netties