I am introducing Fat Free Framework. I am trying to query a database and return the result in json format.
$user=new DB\SQL\Mapper($db,'wilt');
$filter = array();
$option = array(
'order' => 'created DESC',
'limit' => 7
);
$list=$user->find($filter,$option);
echo json_encode($list);
When I use $ list = $ user-> find ($ filter, $ option), it returns 3 empty entries. When I use $ list = $ user-> cast (), it returns a single record with fields, but the values are zero.
How can I combine search and casting?
teee2 source
share