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

Select query by REGEXP error

Hi,

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.



51.2k

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.