WilliamMute
Programmer
- Jan 4, 2006
- 117
Hi all,
I have been having a Shopping cart problem in the PHP forum for few days now for history see( )
Now I have got to the state that I was told that my problem is more for the MYSQL forum. I would appreciate any help on the reason why I am getting this error on the following sql statement I am REALLY exhausted of ideas all I need is a shopping cart!
CODE
The Error that I am getting is:
Please help if you can...
I have been having a Shopping cart problem in the PHP forum for few days now for history see( )
Now I have got to the state that I was told that my problem is more for the MYSQL forum. I would appreciate any help on the reason why I am getting this error on the following sql statement I am REALLY exhausted of ideas all I need is a shopping cart!
CODE
Code:
mysql_select_db($database_Connection, $Connection);
$query = "SELECT SUM(products.product_price * springrisecart.quantity) AS subtotal,
SUM(subtotal) as total
FROM springrisecart, products
WHERE (springrisecart.session) = '$cart_id' AND
(springrisecart.product_id) = 'products.id'";
echo '<pre>';
echo $query;
echo '</pre>';
$result = mysql_query($query, $Connection) or die(mysql_error());
$row = mysql_fetch_assoc($result);
return $row['total'];
$Final = $result;
The Error that I am getting is:
Code:
SELECT SUM(products.product_price * springrisecart.quantity) AS subtotal,
SUM(subtotal) as total
FROM springrisecart, products
WHERE (springrisecart.session) = 'aaeb4f91f7695b77b61fffb4b04fbfa3' AND
(springrisecart.product_id) = 'products.id'
Unknown column 'subtotal' in 'field list'
Please help if you can...