Can someone help me to get done this query with Codeigniter Active record ?:
i have a int array with two values :
$prices = array(
[0] => 23,
[1] => 98
);
how i can make something like :
return $this->db->query("select * from product where price IN (?)", array(implode(',',$prices))->result();
Any help please.
Try this (untested)
The CodeIgniter Active Record docs are very good so you should definitely read up on it. For instance you’ll notice the
select()method is unecessary since we want all items so*is assumed.