Here is my normal sql query using implode function:
SELECT * from search_result WHERE skills IN ('".implode("','",$s_id)."');
Now I want to convert this to codeigniter form. I tried the following code but it fails
$this->db->from('search_result');
$this->db->where_in('skills','".implode("','",$s_id)."');
$query = $this->db->get();
Here is my $s_id
array:
Array ( [0] => 2D Design [1] => 3D Design [2] => 3D Modelling )
So anyone please help me to do this. Thanks in advance :)
Official Doc say's
Try like below
Method 01(recommended )
Method 02
Whats wrong on this line
don't wrap function with
'
or"
quotes. Then it will get save as STRING value to DB.Links
where_in
clause in codeigniter.comYou can just write this :
Official doc