Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Bug - REGEXP MYsql Not working

I'm having a bug look like a parse on phalcon, because at the console works fine the query ! Thanks

$select = self::query(); $select->where("chave REGEXP('^_')"); return $select->execute();


Phalcon\Mvc\Model\Exception: Syntax error, unexpected token IDENTIFIER(REGEXP), near to '('^')', when parsing: SELECT [Apps\Models\ConteudosMeta].* FROM [Apps\Models\ConteudosMeta] WHERE chave REGEXP('^') (94) /var/www/html/production/www/apps/models/ConteudosMeta.php (66)


0 Phalcon\Mvc\Model\Query->parse()

1 Phalcon\Mvc\Model\Query->execute()

2 Phalcon\Mvc\Model::find(Array([di] => Object(Phalcon\Di\FactoryDefault), [conditions] => chave REGEXP('^_')))

3 Phalcon\Mvc\Model\Criteria->execute()


REGEXP is a custom SQL extension that is not supported by PHQL. You can create a custom dialect function to support it: