php – 除非它们包含“where”或“like”子句,否则不允许删除
发布时间:2020-12-13 16:52:28 所属栏目:PHP教程 来源:网络整理
导读:我的查询 – $shortlistpartners是数组 $this-db-delete('shortlist_partners');$this-db-where('opp_id',$this-input-post('opp_id'));$this-db-where_in('partner_id',$shortlistpartners); 除非它们包含“where”或“like”子句,否则不允许删除. 错误即将
我的查询 –
$shortlistpartners是数组 $this->db->delete('shortlist_partners'); $this->db->where('opp_id',$this->input->post('opp_id')); $this->db->where_in('partner_id',$shortlistpartners); 除非它们包含“where”或“like”子句,否则不允许删除. 解决方法
实际上,CI
delete() 方法返回no where或limit error on:
从Source Code开始: if (count($this->ar_where) == 0 && count($this->ar_wherein) == 0 && count($this->ar_like) == 0) { if ($this->db_debug) { return $this->display_error('db_del_must_use_where'); } return FALSE; } 所以我想你需要做的就是用删除调用交换你的wheres: $this->db->where('opp_id',$shortlistpartners); $this->db->delete('shortlist_partners'); (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |