Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Versicherung</title>
- <meta charset="utf-8">
- <meta name="versicherung" content="width=device-width, initial-scale=1.0">
- <link rel="stylesheet" type="text/css" href="styles.css"/>
- </head>
- <body>
- <?php
- $suchauswahl = $_POST['suchauswahl'];
- $suchbegriff = $_POST['suchbegriff'];
- $suchauswahl = addslashes($suchauswahl);
- $db = new mysqli("localhost","supermario","1234","versicherung");
- if (mysqli_connect_errno())
- {
- echo "Fehler bei der Verbindung zur Datenbank";
- echo mysqli_connect_error();
- exit;
- }
- // Ausgabe "Alle Fahrzeuge"
- if ($suchauswahl == 'alle Fahrzeuge')
- {
- $abfrage = "SELECT Hersteller, Typ FROM fahrzeug";
- }
- $ergebnis = $db->query($abfrage);
- $anz_ergebnis = mysqli_num_rows($ergebnis);
- if($suchauswahl == 'alle Fahrzeuge')
- {
- echo "<table><thead><td>Position</td><td>Fahrzeughersteller</td><td>Typ</td></thead>";
- $i=1;
- while($row = mysqli_fetch_assoc($ergebnis))
- {
- echo"<tbody><tr><td>".($i)."</td><td>".stripslashes($row["Hersteller"])."</td><td>".stripslashes($row["Typ"])."</tr></tbody>";
- $i++;
- }
- echo "</table>";
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment