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.
engelsystem/includes/funktion_db_list.php

67 lines
1.3 KiB
PHTML

<?PHP
14 years ago
function funktion_db_list($Table_Name)
{
global $con;
14 years ago
$SQL = "SELECT * FROM `".$Table_Name."`";
$Erg = mysql_query($SQL, $con);
14 years ago
// anzahl zeilen
$Zeilen = mysql_num_rows($Erg);
14 years ago
$Anzahl_Felder = mysql_num_fields($Erg);
14 years ago
echo "<table border=1>";
14 years ago
echo "<tr>";
for ($m = 0 ; $m < $Anzahl_Felder ; $m++)
{
echo "<th>". mysql_field_name($Erg, $m). "</th>";
}
echo "</tr>";
14 years ago
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>";
}
14 years ago
function funktion_db_element_list_2row( $TopicName, $SQL)
{
global $con;
echo "<table class=\"border\" cellpadding=\"2\" cellspacing=\"1\">\n";
echo "<caption>$TopicName</caption>";
# echo "\t<tr class=\"contenttopic\"> <td><h1>$TopicName</h1></td> </tr>\n";
$Erg = mysql_query($SQL, $con);
echo mysql_error($con);
echo "<tr class=\"contenttopic\">";
for ($m = 0 ; $m < mysql_num_fields($Erg) ; $m++)
{
echo "<th>". mysql_field_name($Erg, $m). "</th>";
}
echo "</tr>";
for ($n = 0 ; $n < mysql_num_rows($Erg) ; $n++)
{
echo "<tr class=\"content\">";
for ($m = 0 ; $m < mysql_num_fields($Erg) ; $m++)
{
echo "<td>".mysql_result($Erg, $n, $m). "</td>";
}
echo "</tr>";
}
echo "</table>\n";
}
?>