I have an array of values that I want to check using the mysql IN() function but how do I use it with codeigniter?
This is what I'm currently doing which obviously doesn't work.
$p = array('page1', 'page2', 'page3','page4', 'page5');
$pages = implode(",", $p);
$sql = "select page from pages where domains_id = ? and page in(?) and is_deleted=0";
$fields = array($domains_id, $pages);
$this->db->query($sql, $fields)
the output of the pages variable comes out to page1,page2,page3,... but the in function needs them seperated like this:
'page1','page2','page3'....