<?php
include('dbconnection.php');


$sql = "SELECT * FROM SMS WHERE Ping_sound='0' ORDER BY id DESC LIMIT 1";
$result = mysqli_query($con, $sql);

$messages = [];
while ($row = mysqli_fetch_assoc($result)) {
    $messages[] = $row;
}

header('Content-Type: application/json');
echo json_encode($messages);
?>
