有谁知道,删除操作中的 CRUD 是否存在错误。数据库适配器:
$this->_db = Zend_Registry::get("db");
我喜欢这样:
$sql = "DELETE FROM premium_items WHERE id = '$id'";
$stmt = new Zend_Db_Statement_Pdo($this->_db, $sql);
return $stmt->execute();
和
$sql = "DELETE FROM premium_items WHERE id = ?";
$stmt = new Zend_Db_Statement_Pdo($this->_db, $sql);
return $stmt->execute(array($id));
和
$this->_db->delete('premium_items', "id = '$id'");
每个变体都可以正常工作,但不会做它必须做的事情。在这种情况下我该怎么办?