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

I had a strange problem with the application of Phalcon, and needed to help answer the question.

<?php use Phalcon\Mvc\Micro, Phalcon\Db\Adapter\Pdo\Mysql as test; $app = new Micro (); // Set up the database service $app ['db'] = function () { return new test ( array ( "host" => "127.0.0.1", "username" => "root", "password" => "root", "dbname" => "test" ) ); }; $phql = "select * from test"; $robots = $app ['db']->query ( $phql ); echo '<pre>'; var_dump ( $robots );

//Tips:The results are empty



43.9k
edited May '15

Hi,

what you call "test" is a database connection NOT a table from where you can fetch rows with a phql query like "SELECT * ..."

Have you already define any Model ?