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

phalcon orm problem

I used find, but throw this error:

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens' in

my query array is

array(4) { ["conditions"]=> string(54) "rcodeall LIKE '%:codeall_like:' and rstatus = :status:" ["bind"]=> array(2) { ["codeall_like"]=> string(12) "/index/index" ["status"]=> int(1) } ["hydration"]=> int(1) ["columns"]=> string(3) "rid" }

any one can help me?



51.1k
Accepted
answer

Try this:

        YourModel::find(array(
            'rcodeall LIKE :codeall_like:',
            'bind' => array(
                'codeall_like' => '%/index/index',
            ),
        ));

You are right, i'm success Thank you!