![]() |
Problem with Query Builder Not Returning Results for a LIKE Query - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Problem with Query Builder Not Returning Results for a LIKE Query (/showthread.php?tid=91406) |
Problem with Query Builder Not Returning Results for a LIKE Query - modismos - 08-05-2024 Hi everyone, I've recently started working with CodeIgniter 4, and I'm encountering an issue with the Query Builder when using the LIKE clause. I'm trying to filter records from my database based on a search term, but it seems like the query isn't returning any results, even though I know matching records exist. Here's a simplified version of my code: Code: $searchTerm = 'example'; I've checked my database, and there are definitely rows where column_name contains the word 'example'. I've tried tweaking the query, but no luck so far. Could it be something related to how CodeIgniter 4 handles the like clause or perhaps an issue with the character encoding? Any insights or suggestions on what I might be doing wrong would be greatly appreciated. Thanks and Regards, Elena Idioms RE: Problem with Query Builder Not Returning Results for a LIKE Query - kenjis - 08-06-2024 Check the real SQL statement that are executed by Debug Toolbar. RE: Problem with Query Builder Not Returning Results for a LIKE Query - kenjis - 08-06-2024 (08-05-2024, 08:06 PM)modismos Wrote: Could it be something related to how CodeIgniter 4 handles the like clause or perhaps an issue with the character encoding? If you use an incorrect character encoding, yes, you would have issues. |