use Phalcon\Mvc\Controller;
class TestController extends Controller {
public function searchAction()
{
$res = $this->db->fetchOne('select * from products');
echo "<pre>";
var_dump($res);
echo "</pre>";
$data = Products::find();
echo "<pre>";
var_dump($data->count());
echo "</pre>";
}
}
code is above ,raw sql is use, but Products model can't find data.
Can you show us the code for the two variants?