Commit 8e0db099 authored by Jasin's avatar Jasin

Added Endpoint for stats at mainpage

parent 83958939
<?php
header('Access-Control-Allow-Origin: *');
require ("db.php");
$sql = 'select CAST(created AS DATE) as \"created\", SUM(delay) as \"delays\" from rnv.tours group by CAST(created AS DATE)';
$res = mysqli_query($conn, $sql);
if ($conn->errno)
{
die ("Fehler beim lesen der Datenbank");
}
$temp = array();
while($row = $res->fetch_assoc())
{
array_push($temp, $row);
}
die(json_encode($temp));
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment