You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.5 KiB
PHTML
63 lines
1.5 KiB
PHTML
14 years ago
|
<?php
|
||
17 years ago
|
|
||
|
|
||
14 years ago
|
// Gibt eine Tabelle generisch als HTML aus
|
||
|
function funktion_db_list($Table_Name) {
|
||
|
global $con;
|
||
17 years ago
|
|
||
14 years ago
|
$html = "";
|
||
17 years ago
|
|
||
14 years ago
|
$SQL = "SELECT * FROM `" . $Table_Name . "`";
|
||
|
$Erg = mysql_query($SQL, $con);
|
||
17 years ago
|
|
||
14 years ago
|
// anzahl zeilen
|
||
|
$Zeilen = mysql_num_rows($Erg);
|
||
17 years ago
|
|
||
14 years ago
|
$Anzahl_Felder = mysql_num_fields($Erg);
|
||
17 years ago
|
|
||
14 years ago
|
$html .= "<table class=\"border\" cellpadding=\"2\" cellspacing=\"1\">";
|
||
|
$html .= "<caption>DB: $Table_Name</caption>";
|
||
14 years ago
|
|
||
14 years ago
|
$html .= "<tr class=\"contenttopic\">";
|
||
|
for ($m = 0; $m < $Anzahl_Felder; $m++) {
|
||
|
$html .= "<th>" . mysql_field_name($Erg, $m) . "</th>";
|
||
|
}
|
||
|
$html .= "</tr>";
|
||
14 years ago
|
|
||
14 years ago
|
for ($n = 0; $n < $Zeilen; $n++) {
|
||
|
$html .= "<tr class=\"content\">";
|
||
|
for ($m = 0; $m < $Anzahl_Felder; $m++) {
|
||
|
$html .= "<td>" . mysql_result($Erg, $n, $m) . "</td>";
|
||
|
}
|
||
|
$html .= "</tr>";
|
||
|
}
|
||
|
$html .= "</table>";
|
||
|
return $html;
|
||
17 years ago
|
}
|
||
|
|
||
14 years ago
|
function funktion_db_element_list_2row($TopicName, $SQL) {
|
||
|
$html = "";
|
||
|
$html .= "<table class=\"border\" cellpadding=\"2\" cellspacing=\"1\">\n";
|
||
|
$html .= "<caption>$TopicName</caption>";
|
||
|
# $html .= "<tr class=\"contenttopic\"> <td><h1>$TopicName</h1></td> </tr>\n";
|
||
|
|
||
|
$Erg = sql_query($SQL);
|
||
|
|
||
|
$html .= "<tr class=\"contenttopic\">";
|
||
|
for ($m = 0; $m < mysql_num_fields($Erg); $m++) {
|
||
|
$html .= "<th>" . mysql_field_name($Erg, $m) . "</th>";
|
||
|
}
|
||
|
$html .= "</tr>";
|
||
|
|
||
|
for ($n = 0; $n < mysql_num_rows($Erg); $n++) {
|
||
|
$html .= "<tr class=\"content\">";
|
||
|
for ($m = 0; $m < mysql_num_fields($Erg); $m++) {
|
||
|
$html .= "<td>" . mysql_result($Erg, $n, $m) . "</td>";
|
||
|
}
|
||
|
$html .= "</tr>";
|
||
|
}
|
||
|
$html .= "</table>\n";
|
||
|
return $html;
|
||
|
}
|
||
17 years ago
|
?>
|