Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.


$query = new Phalcon\Mvc\Model\Query("select *,count( as count from Family,FamilyUsers where group by family_id order by count limit 15",$this -> getDI());
$power_family = $query -> execute();

Could you tell me how can I get a query out value?

edited Dec '14
$q = new \Phalcon\Mvc\Model\Query("SELECT * FROM Users", $this->getDI()); // Users model class
$result = $q->execute();
foreach ($result as $row) {
    echo "Name: ", $row->name, "<br>";
    echo "Email: ", $row->email, "<br>";

(Edit: Please ignore this part if it doesn't apply) Since you are using the limit, group by clauses, you could also use the find() method in Phalcon\Mvc\Model ( There is a separate static count() method in there too.