为什么执行语句时得到的答案乘以2。 任何提供的帮助将不胜感激。下面是我的代码。
$this->db->query("
UPDATE ip_products
SET Quantity = Quantity -(SELECT item_quantity FROM ip_invoice_items WHERE invoice_id = " . $this->db->escape($invoice_id) . ")
WHERE product_id = (SELECT item_product_id from ip_invoice_items WHERE item_id = ( SELECT item_id FROM ip_invoice_items WHERE invoice_id = " . $this->db->escape($invoice_id) . "))
");