我的查询 –
$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:
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',$this->input->post('opp_id'));
$this->db->where_in('partner_id',$shortlistpartners);
$this->db->delete('shortlist_partners');
标签:php,mysql,codeigniter
来源: https://codeday.me/bug/20190629/1323312.html