include 'config_file.php'; $message = ''; $connection = new mysqli($host_name, $host_user, $host_password, $database_name); if ($connection->connect_error) { die("Connection failed: " . $connection->connect_error); } $json = json_decode(file_get_contents('php://input'), true); $check_query = "SELECT * FROM Notification_Times_Table WHERE user = '$json[user]' ORDER BY RAND() LIMIT 1000"; $result = mysqli_query($connection, $check_query); $a = array(); if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { array_push($a, ["time_display"=>$row["time_display"], "time_key"=>$row["time_key"], "user"=>$row["user"]]); } } echo json_encode($a); $connection->close(); ?>