Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <body>
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "iskolai";
- // Create connection
- $conn = mysqli_connect($servername, $username, $password, $dbname);
- // Check connection
- if (!$conn) {
- die("Kapcsolódási hiba: " . mysqli_connect_error());
- }
- $sql = "SELECT * FROM ital";
- $result = mysqli_query($conn, $sql);
- if (mysqli_num_rows($result) > 0) {
- // output data of each row
- echo "<table border='10'>";
- echo "<tr>";
- echo "<th>";
- echo "Nev";
- echo "</th>";
- echo "<th>";
- echo "Mennyiseg";
- echo "</th>";
- echo "<th>";
- echo "Ar";
- echo "</th>";
- echo "<tr>";
- while($row = mysqli_fetch_assoc($result)) {
- echo "<tr>";
- echo "<td>" . $row["ital_nev"] . "</td>";
- echo "<td>" . $row["ital_mennyiseg"] . "</td>";
- echo "<td>" . $row["ital_ar"] . "</td>";
- echo "<tr>";
- }
- echo "</table>";
- } else {
- echo "RIP";
- }
- mysqli_close($conn);
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement