php repozitar
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

41 lines
1.1 KiB

<?php
//napojení na DB
require "init.php";
//příprava k zobrazení dat
$sql = "SELECT * FROM intro ";
$result = mysqli_query($conn,$sql);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
</head>
<body>
<!-- FORMULÁŘ PRO ODESILÁNÍ NOVÝ KNÍŽKY -->
<form action="insert.php" method="get">
<input type="text" name="nazev" id="nazev" placeholder="nazev"><br>
<input type="text" name="autor" id="autor" placeholder="autor"><br>
<input type="submit" value="Odeslat">
</form>
<!-- TABULKA PRO VYPISOVÁNÍ Z DATABÁZE -->
<ul>
<?php
//vypsat data
if (mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_assoc($result)){
echo "<li>" . $row["id"]. ") ". $row["nazev"]." <-- ". $row["autor"]."</li>";
}
}
?>
</ul>
</body>
</html>