Hi,
Can anyone please help me with this sql query?
This code is for use in a shopping cart, I am not sure how to get it to subtract '1' from the 'quantity' row in the table.
include("../CMS/script-files/db-connect.php");
$SQL = " UPDATE products SET";
$SQL = $SQL . " quantity = '??? MINUS 1' WHERE id = '$id'";
#execute SQL statement
$result = mysql_db_query($db,"$SQL",$cid);
# check for error
if (!$result) { echo("ERROR: " . mysql_error() . "\n$SQL\n"); }
mysql_close($cid);