summaryrefslogtreecommitdiff
path: root/inc/funktion_db_list.php
blob: 894de5e5d39fab71d5b7844ffb594b31146c8dc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?PHP

function funktion_db_list($Table_Name) {

include ("./inc/db.php");

$SQL = "SELECT * FROM `".$Table_Name."`";
$Erg = mysql_query($SQL, $con);

// anzahl zeilen
$Zeilen  = mysql_num_rows($Erg);

$Anzahl_Felder = mysql_num_fields($Erg);

echo "<table border=1>";

echo "<tr>";
for ($m = 0 ; $m < $Anzahl_Felder ; $m++) {
  echo "<th>". mysql_field_name($Erg, $m). "</th>";
  }
echo "</tr>";

for ($n = 0 ; $n < $Zeilen ; $n++) {
  echo "<tr>";
  for ($m = 0 ; $m < $Anzahl_Felder ; $m++) {
    echo "<td>".mysql_result($Erg, $n, $m). "</td>"; 
  }
  echo "</tr>";
}

echo "</table>";
}

?>