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

Scanning error before in model find()

when i try to do this code

$officemachines = Officemachine::find(array( "conditions"=>"active = :active: AND brands_id IN ({brandsId:array})" , "bind" => array("active" => '1' ,"brandsId" => $arrayBrand), "order" => "exist ASC, priceupdate DESC", ));

i got this error

Scanning error before 'brandsId:array})...' when parsing: SELECT [Officemachine].* FROM [Officemachine] WHERE active = :active: AND brands_id IN ({brandsId:array}) ORDER BY exist ASC, priceupdate DESC (142)



31.3k

{brandsId:array} should not be an array but a string with commas, I think.

that is not the problem i try using string but i got an error again

https://docs.phalcon.io/en/latest/reference/models.html#binding-parameters

that is the documentation on phalcon i use