We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Case insensitive LIKE with PHQL

Hi

I'm porting my company's to Phalcon, We use MySQL, and when filtering data, use a query like this:

SELECT * from users where LOWER(name) LIKE LOWER(:name);

In the docs, I've seen that PHQL supports functions (TRIM, even custom ones) but I haven't been able to find a list of supported functions or how could one implement a custom one.

Any help would be appreciated.

Thanks



77.7k
Accepted
answer

MySQL is case insensitive, unless declared/collated as binary.

On custom functions, check out this: https://gist.github.com/andresgutierrez/2a729903f4b189e3ce75



3.6k

Thank you very much.