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 = "ci3o117";
- // Verbindung herstellen
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Verbindung überprüfen
- if ($conn->connect_error)
- {
- die("Connection failed: " . $conn->connect_error);
- }
- // Daten der Tabelle auswählen
- $sql = "SELECT * FROM person";
- $result = $conn->query($sql);
- if ($result->num_rows > 0)
- {
- // Daten jeder Zeile ausgeben
- while($row = $result->fetch_assoc())
- {
- echo "id: " . $row["PersonID"]. " - Name: " . $row["Vorname"]. " " . $row["Nachname"]. "<br>";
- }
- }
- else
- {
- echo "Keine Einträge gefunden";
- }
- $conn->close();
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement