php where 不包含,php – 除非它们包含“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:
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
總結
以上是生活随笔為你收集整理的php where 不包含,php – 除非它们包含“where”或“like”子句,否则不允许删除的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: php 年的第几天,收藏-php中某年第
- 下一篇: php图片截取后缀,PHP抓取远程图片(