<style>
    table {
        border-collapse: collapse;
        width: 50%;
    }
    
    th, td {
        padding: 8px;
        text-align: left;
        border-bottom: 1px solid #ddd;
    }
    
    th {
        background-color: #9ACD32;
    }
</style>

<?php
$servername = "localhost";
$username = "pail";
$password = "password";
$dbname = "download";

try {
    $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
    $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

    // Výpis záznamov z tabulky "download"
    $sql = "SELECT * FROM download";
    $stmt = $conn->query($sql);
    $result = $stmt->fetchAll(PDO::FETCH_ASSOC);

    echo "<h2>Záznamy zo stahovaní:</h2>";
    echo "<table>";
    echo "<tr><th>ID</th><th>IP adresa</th></tr>";
    foreach ($result as $row) {
        echo "<tr><td>".$row['id']."</td><td>".$row['IP']."</td></tr>";
    }
    echo "</table>";

} catch(PDOException $e) {
    echo "Chyba pri pripájaní k databáze: " . $e->getMessage();
}
?>