<?php
$servername = "localhost";
$username = "kolejni";
$password = "admin";
$dbname = "brno";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
} 

$sql = "SELECT id, tagID, time, action  FROM readings";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
    
    // output data of each row
    while($row = $result->fetch_assoc()) {
        echo "time: ". $row["time"]. " id: " . $row["id"]. " - tagID: " . $row["tagID"]. " akcia: " . $row["action"]. "<br>";
    }
} else {
    echo "0 results";
}
$conn->close();
?>
