<?php
include "db.php";
$res = $mysqli->query("SELECT * FROM news ORDER BY id DESC");
echo json_encode($res->fetch_all(MYSQLI_ASSOC));
?>
