Backend óra (2024. 11. 25.)

This commit is contained in:
Tóth Ádám
2024-11-26 09:59:04 +01:00
parent 099bd2a5ce
commit 8361384e9e
3 changed files with 62 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
<?php
require_once("config.php");
if (isset($_POST["szures"])) {
$felt = $_POST["szures"];
$sql = "SELECT cim, jegyar FROM film WHERE cim LIKE '%".$felt."%' ORDER BY cim ";
$result = $conn -> query($sql);
if ($result -> num_rows > 0) {
$i = 1;
echo "<table>
<tr><th>Ssz.</th>
<th>Cím.</th>
<th>Ár.</th>
<tr>";
while ($row = $result -> fetch_object()) {
echo "<tr>
<td>".$i++."</td>
<td>".$row -> cim."</td>
<td>".$row -> jegyar."</td>
</tr>";
}
echo "</table>";
}
}
else {
echo "Nincs adat";
}
require_once("html.php");
$conn -> close()
?>