CodeIgniter Forums
Active Record Delete - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Active Record Delete (/showthread.php?tid=2676)



Active Record Delete - El Forum - 08-18-2007

[eluser]Kemik[/eluser]
Hello,

Is it possible to add an "OR" to the active record delete? I want to delete a record where the permission_id = 7 or 8.

$this->db->where('id', $id);
$this->db->delete('mytable');

If not, I'll just use the regular $query = "INSERT QUERY HERE";
$query = $this->db->query($query);

Thanks.


Active Record Delete - El Forum - 08-18-2007

[eluser]Michael Wales[/eluser]
Code:
$this->db->where('id', '7');
$this->db->orwhere('id', '8');
$this->db->delete('mytable');



Active Record Delete - El Forum - 08-18-2007

[eluser]Kemik[/eluser]
Thanks walesmd. I should look at the userguide in more detail in future.