I\'ve written a simple query for searching a keyword in the database.
$keyword = \"keyword sample\";
$keyword = str_replace(\" \", \"%\", $keyword);
$th
If you dig a bit into CodeIgniter's internals, you'll notice that the $this->db->like() function escapes special characters it contains - including, of course, %.
I don't think like() will help you much with your particular needs. Your best bet, I guess, would be to bypass the problem and use a where function containing your LIKE clause:
$this->db->select('*')->from('table')->where("column LIKE '%$keyword%'")->get()->result_array();