<?php
$db = mysqli_connect('localhost', 'root', '', 'wyprawy');
?>
<!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 3</title>
    <style> td, th, table { border: 1px black solid; border-collapse: collapse}</style>
</head>
<body>
<h2>Kwerenda 3</h2>
<p>Kwerenda: <code>SELECT nazwa, cena, link_obraz FROM miejsca WHERE link_obraz LIKE '0%';</code></p>
<?php
$query = "SELECT nazwa, cena, link_obraz FROM miejsca WHERE link_obraz LIKE '0%'";
$result = mysqli_query($db, $query);
echo "<table>";
echo "<tr><th>Nazwa</th><th>Cena</th><th>Link obrazu</th></tr>";
while ($row = mysqli_fetch_assoc($result)) {
    echo "<tr>";
    echo "<td>" . $row['nazwa'] . "</td><td>" . $row['cena'] . "</td><td>" . $row['link_obraz'] . "</td>";
    echo "</tr>";
}
echo "</table>";
?>
</body>
</html>
<?php mysqli_close($db); ?>
