We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Select query by REGEXP error


When i try to execute a query using the mysql regexp, i get this error:

Phalcon\Mvc\Model\Exception: Syntax error, unexpected token IDENTIFIER(regexp), near to ' "^:name:"', when parsing: SELECT * FROM Model WHERE name regexp "^:name:" (79)

I have tried with Model::find(" name REGEXP '^bla' ") and also with PHQL. Any ideas ?

PhalconPHP 1.3.0.


It is not a bug. It is something that would be nice to have. Not all builtin functions of a DB system are supported by the ORM. Use raw sql instead.