I get error Exception: SQLSTATE[HY093]: Invalid parameter number
on phalcon
$phql = "SELECT Matches.* FROM \Api\Model\Matches as Matches
WHERE (Matches.user1_id = :user1_id: AND Matches.user2_id = :user2_id:) OR (Matches.user1_id = :user2_id: AND Matches.user2_id = :user1_id:)";
$rows = $this->modelsManager->executeQuery($phql, [
"user1_id" => $user1_id,
"user2_id" => $user2_id
]);
but it works:
$phql = "SELECT Matches.* FROM \Api\Model\Matches as Matches
WHERE (Matches.user1_id = :user1_id: AND Matches.user2_id = :user2_id:) OR (Matches.user1_id = :user3_id: AND Matches.user2_id = :user4_id:)";
$rows = $this->modelsManager->executeQuery($phql, [
"user1_id" => $user1_id,
"user2_id" => $user2_id,
"user3_id" => $user1_id,
"user4_id" => $user2_id
]);
Phalcon Version: 3.2.0
PHP Version: 7.1.5
Is this normal behavior or not? Thank you.