I want to store query conditions in variable, beacuse same conditions can be used in different places so I created on function and used concatenation, but it is not storing any query condition.
Code:
$records; // empty varaible to store all conditions using concatenation
if ($val->id != '')
$records .=$this->db->where('table.column', $val->id, true);
if ($val->percentage != '')
$records .=$this->db->or_where('table.column', $val->percentage, true);
return $records;