asd
This commit is contained in:
parent
484964820c
commit
8b8e8f2ad4
13
20241125/config.php
Normal file
13
20241125/config.php
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?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);
|
||||
} else {
|
||||
echo "Sikerült a kapcsolat. <br>";
|
||||
}
|
65
20241125/index.php
Normal file
65
20241125/index.php
Normal file
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
include_once("config.php");
|
||||
|
||||
if(isset($_POST["szures"])){
|
||||
$felt = $_POST["szures"];
|
||||
|
||||
$sql = "SELECT * FROM film order by cim";
|
||||
|
||||
$result = $conn->query($sql);
|
||||
|
||||
if ($result->num_rows > 0){
|
||||
/*
|
||||
while ($row = $result->fetch_assoc()){
|
||||
echo $row["cim"]."<br>";
|
||||
}
|
||||
*/
|
||||
echo "
|
||||
<table>
|
||||
<tr>
|
||||
<th>
|
||||
Ssz.
|
||||
</th>
|
||||
<th>
|
||||
Cím
|
||||
</th>
|
||||
<th>
|
||||
Ár
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
";
|
||||
|
||||
$counter = 1;
|
||||
while ($row = $result->fetch_object()){
|
||||
echo "<tr>
|
||||
<td>".$counter."</td>".
|
||||
"<td>".$row->cim."</td>".
|
||||
"<td>".$row->jegyar."Ft </td></tr>";
|
||||
$counter++;
|
||||
}
|
||||
|
||||
echo "</table>";
|
||||
} else {
|
||||
echo "Nincs adat";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<?php
|
||||
$conn->close();
|
||||
?>
|
2847
20241125/mozi.sql
Normal file
2847
20241125/mozi.sql
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user