【发布时间】:2012-12-27 15:17:38
【问题描述】:
我正在尝试使用此查询更新表,但似乎不起作用。
$query="UPDATE product SET qty = (qty - '$qty') WHERE barcode = '$barcode'";
$result = $this->db->conn_id->prepare($query);
$result->execute();
我尝试将查询放在 try catch 块中,但它不会引发任何错误。问题在于 CodeIgniter 中的实现,因为此查询在 codeigniter 外部执行时有效。
【问题讨论】:
-
conn_id指的是什么?我在documentation 的示例中没有看到这一点。
标签: php codeigniter