CodeIgniter Forums
Coddeigniter DB Like Query - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: Coddeigniter DB Like Query (/thread-63268.html)



Coddeigniter DB Like Query - nexobm93 - 10-14-2015

Hy guys,

I have a problem with like query.

I use $this->db->like('field', 'value');

All works well but when 'search string' contain 'and' doesn't work.

In this case my search string is 'Health and Safety'. As you can see below, after 'and' word from string exists one more whitespace.

This is what it trying to do.
"WHERE c.course_title LIKE '%Health and Safety%' ESCAPE '!'"

I think this is for security but how can a solve this problem. Cuz my query doesn't works with two whitespaces.

Thanx


RE: Coddeigniter DB Like Query - Narf - 10-14-2015

Update CI to version 3.0.2, it's a bug that's already fixed in there.


RE: Coddeigniter DB Like Query - nexobm93 - 10-14-2015

(10-14-2015, 06:22 AM)Narf Wrote: Update CI to version 3.0.2, it's a bug that's already fixed in there.

This is good to know. Thanx for your answare. Have a nice day.