netv-mam/schedule.php

19 lines
423 B
PHP
Raw Normal View History

2024-09-10 16:44:22 -04:00
<?php
$db = new SQLite3('netv-mam.sqlite');
if (isset($_GET['date']) && $_GET['date'] !== "") {
// get info about single day's schedule
$query = $db->prepare("SELECT * FROM schedules WHERE date = :date");
$query->bindValue(":date", intval($_GET['date']));
$result = $query->execute();
if ($result) {
$row = $result->fetchArray(SQLITE3_ASSOC);
echo(json_encode($row));
}
} else {
echo("{}");
}
?>