This commit is contained in:
3p01
2026-03-19 09:27:05 +01:00
parent b4f7c3bee0
commit b03da28771
9 changed files with 5560 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 596 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 KiB

View File

@@ -0,0 +1,41 @@
<?php
$db = mysqli_connect('localhost', 'root', '', 'biblioteka');
if (!$db) {
die("Connection failed: " . mysqli_connect_error());
}
?>
<!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 autor, tytul, kod FROM ksiazki ORDER BY RAND() LIMIT 5;</code></p>
<?php
$query = "SELECT autor, tytul, kod FROM ksiazki ORDER BY RAND() LIMIT 5;";
$result = mysqli_query($db, $query);
if (mysqli_num_rows($result) != 0) {
echo "<table>";
echo "<tr><th>Autor</th><th>Tytul</th><th>Kod</th></tr>";
while ($row = mysqli_fetch_assoc($result)) {
echo "<tr>";
echo "<td>" . $row['autor'] . "</td><td>" . $row['tytul'] . "</td><td>" . $row['kod'] . "</td>";
echo "</tr>";
}
echo "</table>";
} else {
echo "Brak wyników.";
}
?>
</body>
</html>
<?php
mysqli_close($db);

Binary file not shown.

After

Width:  |  Height:  |  Size: 418 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 KiB

View File

@@ -0,0 +1,4 @@
SELECT nazwisko, imie, klasa, data_wypozyczenia FROM uczniowie WHERE data_wypozyczenia > "2020-03-02";
SELECT nazwisko, imie, data_wypozyczenia, autor, kod FROM uczniowie JOIN ksiazki ON ksiazki.id = uczniowie.id_ksiazki;
DELETE FROM ksiazki WHERE autor = "0";
SELECT autor, tytul, kod FROM ksiazki ORDER BY RAND() LIMIT 5;