This commit is contained in:
szabomarton
2024-12-02 14:36:30 +01:00
parent 8b8e8f2ad4
commit 0b28a908b1
9 changed files with 5869 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
<?php
$server = "localhost";
$user = "root";
$pwd = "";
$db = "13b2";
$conn = new mysqli($server,$user,$pwd,$db);
if ($conn->connect_errno)
{
die("Nem sikerült a kapcsolat kiépítése: ".$conn->connect_error);
}
?>

View File

@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="hu">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Szűrés</title>
</head>
<body>
<form method="POST">
<input type="text" name="szures">
<button type="submit">Szűrés</button>
</form>
</body>
</html>

View File

@@ -0,0 +1,44 @@
<?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();
?>

File diff suppressed because it is too large Load Diff