I am quite new to phalcon and I finally started development, but obviously I kind of hit a wall (something that I expect will happen more often). A need to execute a little complex query, so I started experimenting with PHQL. Unfortunately I already am stuck. The query I will quote is not the one that I am trying to execute, but it seems to me that the problem is the same:
$strsql = "SELECT fldName FROM Field WHERE fldPublish = 1 AND fldSource = :name:";
$query = $this->modelsManager->createQuery($strsql);
$name = $query->execute($strsql, array(
'name' => 'indexController'
));
The query works when I do not bind parameters. When I am trying the above code, I get the following error:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':name' at line 1