php datenbank auslesen und anzeigen

Solutions on MaxInterview for php datenbank auslesen und anzeigen by the best coders in the world

showing results for - "php datenbank auslesen und anzeigen"
Erika
27 Jan 2020
1<?php
2require_once ('konfiguration.php');
3$db_link = mysqli_connect (
4                     MYSQL_HOST, 
5                     MYSQL_BENUTZER, 
6                     MYSQL_KENNWORT, 
7                     MYSQL_DATENBANK
8                    );
9
10$sql = "SELECT * FROM adressen";
11
12$db_erg = mysqli_query( $db_link, $sql );
13if ( ! $db_erg )
14{
15  die('Ungültige Abfrage: ' . mysqli_error());
16}
17
18echo '<table border="1">';
19while ($zeile = mysqli_fetch_array( $db_erg, MYSQLI_ASSOC))
20{
21  echo "<tr>";
22  echo "<td>". $zeile['id'] . "</td>";
23  echo "<td>". $zeile['nachname'] . "</td>";
24  echo "<td>". $zeile['vorname'] . "</td>";
25  echo "<td>". $zeile['akuerzel'] . "</td>";
26  echo "<td>". $zeile['strasse'] . "</td>";
27  echo "<td>". $zeile['plz'] . "</td>";
28  echo "<td>". $zeile['telefon'] . "</td>";
29  echo "</tr>";
30}
31echo "</table>";
32
33mysqli_free_result( $db_erg );
34?>
35