chris_middleton
Thu 3 May 2007, 08:34 pm GMT +0200
just "installing" yourcart for the first time and have set up all the db's etc and now when executing it returns this error: http://www.chrismiddleton.co.uk/rock/classes/db_cart/db_cart_example.php
// show total value of the current cart
function show_total_value() {
$sql = sprintf("SELECT SUM(quantity * price) AS total FROM %s WHERE order_id = %d", ORDER_ROWS, $_SESSION['order_id']);
if (!$result = mysql_query($sql)) {
$this->error = $this->messages(1);
return;
} else {
$total_amount = mysql_result($result, 0, "total");
mysql_free_result($result);
return $total_amount;
}
}
Any help much appreciated,
Thanks,
Chris Middleton
// show total value of the current cart
function show_total_value() {
$sql = sprintf("SELECT SUM(quantity * price) AS total FROM %s WHERE order_id = %d", ORDER_ROWS, $_SESSION['order_id']);
if (!$result = mysql_query($sql)) {
$this->error = $this->messages(1);
return;
} else {
$total_amount = mysql_result($result, 0, "total");
mysql_free_result($result);
return $total_amount;
}
}
Any help much appreciated,
Thanks,
Chris Middleton