<?php
$db = mysqli_connect('localhost', 'root', '', 'przewozy');
?>
    <!doctype html>
    <html lang="pl">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport"
              content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>Kwerenda 4</title>
        <style> td, th, table { border: 1px black solid; border-collapse: collapse}</style>
    </head>
    <body>
    <h2>Kwerenda 4</h2>
    <p>Kwerenda: <code>SELECT imie, nazwisko, telefon, zadanie, data FROM osoby JOIN zadania on osoba_id = id_osoba;</code></p>
    <?php
    $query = "SELECT imie, nazwisko, telefon, zadanie, data FROM osoby JOIN zadania on osoba_id = id_osoba;";
    $result = mysqli_query($db, $query);
    echo "<table>";
    echo "<tr><th>Imie</th><th>Nazwisko</th><th>Telefon</th><th>Zadanie</th><th>Data</th></tr>";
    while ($row = mysqli_fetch_assoc($result)) {
        echo "<tr>";
        echo "<td>" . $row['imie'] . "</td><td>" . $row['nazwisko'] . "</td><td>" . $row['telefon'] . "</td>" . "<td>" . $row['zadanie'] . "</td><td>" . $row['data'] . "</td>";
        echo "</tr>";
    }
    echo "</table>";
    ?>
    </body>
    </html>
<?php
mysqli_close($db);