Phalcon 1.3.3, Percona DB 5.6, Ubuntu.
Trying to get records from db through ORM, all variations doesn't work - i see in mysql log (created by code based on EventsManager injection) queries with bind templates but not actual data.
$types = array( "guid" => Column::BIND_PARAM_STR, ); $parameters = array( "columns" => "parent_id", "conditions" => "guid = :guid:", "bind" => array("guid" => $guid), "bindTypes" => $types ); $category = GoodsCategories::findFirst($parameters);
In my mysql_query.log:
[Sun, 09 Nov 14 05:04:58 +0300][INFO] SELECT
guid = :guid LIMIT 1
As you see, "guid" param not binded, one colon left. Equal results with "conditions" => "guid = ?0" or Criteria-style query.
Query works perfect without binds:
$category = GoodsCategories::findFirst("guid = $guid");
but i lose advanages of bind params.
Model is very simple and doesn't have any relations, only fields with getters/setters: id, parent_id, guid
Where is problem?