当订单在销售点系统中完成时,我正在尝试更新订单中所有商品的库存数量
到目前为止我的代码是
$order=$_GET["order"];
include('php/config.php');
$invoice=$order;
$voucher=$_GET['voucher'];
$card=$_GET['card'];
$cash=$_GET["cash"];
$date = date('Y-m-d');
$sql="SELECT * FROM `orders` WHERE `invoice` = '".$invoice."'";
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)) {
$parts[] = array(
"part" => $row['part'],
"qty" => $row['qty'],
);
$sqlstock = "UPDATE `stock` SET available='available - $parts[qty]' WHERE
part = '".$parts['part']."'";
}