2024-11-26 08:59:04 +00:00
|
|
|
<?php
|
|
|
|
require_once("config.php");
|
|
|
|
|
2024-12-02 13:37:26 +00:00
|
|
|
if (isset($_POST["cim"])) {
|
|
|
|
$cim = $_POST["cim"];
|
|
|
|
$tip = $_POST["tipus"];
|
|
|
|
$ar = $_POST["jegyar"];
|
2024-11-26 08:59:04 +00:00
|
|
|
|
2024-12-02 13:37:26 +00:00
|
|
|
$parsql = "INSERT INTO film (cim, filmtipusID, jegyar) VALUES (?, ?, ?)";
|
|
|
|
|
|
|
|
$durr = $conn -> prepare($parsql);
|
|
|
|
$durr -> bind_param("sii", $cim, $tip, $ar);
|
2024-11-26 08:59:04 +00:00
|
|
|
|
2024-12-02 13:37:26 +00:00
|
|
|
if ($durr -> execute() == true) {
|
|
|
|
echo "<b>Sikeres adatbevitel<b>";
|
2024-11-26 08:59:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
2024-12-02 13:37:26 +00:00
|
|
|
if (isset($_POST["szures"])) {
|
|
|
|
$felt = $_POST["szures"];
|
|
|
|
$sql = "SELECT cim, jegyar FROM film WHERE cim LIKE '%".$felt."%' ORDER BY cim ";
|
|
|
|
$sqlparam = $conn -> prepare("SELECT cim, jegyar FROM film WHERE cim LIKE ? ORDER BY cim ");
|
|
|
|
$sqlparam -> bind_param("s", $felt);
|
|
|
|
$sqlparam -> execute();
|
|
|
|
// $result = $conn -> query($sql);
|
|
|
|
$result = $sqlparam -> get_result();
|
|
|
|
|
|
|
|
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();
|
2024-11-26 08:59:04 +00:00
|
|
|
}
|
|
|
|
?>
|