why is this happening in codeigniter?
$query1 = $this->db ->select('skill_description.description, count(staff_info.staffId) as experienced') ->from('skill_rating') ->join('staff_info','staff_info.staffId = skill_rating.staffId') ->join('skill_description','skill_rating.descriptionId = skill_description.descriptionId') ->where ('skill_rating.rating','2') ->group_by("skill_description.description") ->order_by("skill_description.description asc") ->get();
when I use this I get desired result.. but as soon as I add
it results a null array which it shouldn't. It should return the same result I think. And if I use the pure sql style for the same query, it works. $array contains all the descriptions. what should I do?
IF description has string or text datatype then you should go with LIKE.
$q = $this->db->select('*') ->from('table') ->where("(col LIKE '%".$search_string1."%' OR col LIKE '%".$search_string2."%' OR col LIKE '%".$search_string3."%' OR col LIKE '%".$search_string4."%')", NULL, FALSE) ->get()->results;