I am making a call to the database to fetch some data. I have tried the request in SQL, and it works fine. I have coded the query using PDO, and it works fine. But using RedBeanPHP with the same query only returns one result.
$app->get('/shoutbox/new/:msgid', function ($msgid) use ($app) {
$messages = R::findAll('shoutbox_message', ' WHERE message_id > ? LIMIT 10', array($msgid));
$app->response()->header('Content-Type', 'application/json');
var_dump($messages);
echo json_encode(R::exportAll($messages));
});
I have used var_dump($messages)
to verify there's only one message being returned.
I found a similar problem here, but the OP solved it without explaining how: sql query using redbeans php
Any advice?