Pages

Your Ad Here

This Blog is not to read or go through

because, I have never been such a mess


Search the blog instead

Wednesday, August 19, 2009

codeigniter tweak for find_in_set

It was really really frustrating when i could not find any good function in the Codeigniter Active Record Class for FIND_IN_SET type queries.

So, i just buit this.


$set = implode(',',$where);
$this->db->where('1 <=', "FIND_IN_SET(`".$field."`,".$this->db->escape($set).")",false);

Where $where is an array of values

And Yest , it works with a miracle now.

No comments:

Your Ad Here