Databases: searching for a word in entries containing multiple words using 'like' |
Okay, so, as my actual code involves a complicated JOIN and I couldn't get the SQL query to work, what I've ended up doing is the following:
Code: $this->db->where('title LIKE ', $search.'%'); CI's inbuilt like and or_like seem to be pretty limited when it comes to arguments (before, after, both, none), but utilising where and or_where does the trick for my needs. Thanks for all your help and suggestions pointing me in the right direction.
If you were using CI 4 the query would be very simple, as below:
PHP Code: public function getXpt() Table is about music and film artists.
These functions may be of interest which are used in my DasaBookCafe.tk book search:
Code: /* ================================= |
Welcome Guest, Not a member yet? Register Sign In |