This is my Php file:
$sql = "SELECT * FROM sample";
$r = $conn->query($sql);
$result = array();
while($row = $r->fetch(PDO::FETCH_OBJ)){
array_push($result,array(
"title"=>$row->title
));
}
echo json_encode(array('result'=>$result));
This code fetches the data from my database and displays from first to last order, but I need to create a reverse order (from last to first). Please help.