//calculate current total
$total=$price*$quantity;
$sql41="select orderid, sessionid, total from orders where sessionid='$sessionid'";
$result41 = mysql_query($sql41) or die(mysql_error()) if (mysql_num_rows($result41) )
{
$totalamt = mysql_result($result41, 0, 'total');
}
//calculate accumulating total
$totalamt=$totalamt+$total;
//update database
$sql7="update orders set total='$totalamt' where orderid='$orderid'";
hi
I have a problem with the above code. a webpage can be revisited to add products to a basket. The product details are recorded in the orderdetails table whilst the overall total is stored in the orders tables
Everyting works fine whilst the numbers are below 1,000
If it goes over 1,000 the database
does the following:
9758.40 + 74.95 = 83.95
It's adding the 74.95 (the last product) and only the 9 from the first product
total is set as a "double" in the database
Any ideas would be gratefully appreciated,
Thanks,
Orla