Hi.
When i try to do following.
$app->get('/pictures', function($limit = 10, $offset = 0) use ($app)
{
#$phql = "SELECT p.id, p.filename, p.likes FROM pictures p WHERE p.status = 'active' ORDER BY p.id DESC LIMIT 10 OFFSET 0";
$phql = "SELECT p.id, p.filename FROM pictures p WHERE p.status = 'active' LIMIT :limit: OFFSET :offset: ORDER BY p.date_added DESC";
$pictures = $app->modelsManager->executeQuery($phql, array(
'limit' => $limit,
'offset' => $offset
));
$data = array();
foreach ($pictures as $picture) {
$data[] = array(
'id' => $picture->id,
'filename' => $picture->filename,
'likes' => $picture->likes
);
}
echo json_encode($data);
});
Do i get. Uncaught exception 'Phalcon\Mvc\Model\Exception' with message 'Syntax error, unexpected token ORDER, near to ' BY p.date_added DESC', when parsing: SELECT p.id, p.filename FROM pictures p WHERE p.status = 'active' LIMIT :limit: OFFSET :offset: ORDER BY p.date_added DESC (122)' in /media/sf_pattegufv3/index.php:28
I'm running Micro, 1.3.0/1.3.1