PHP-Code:
<?php
$dbserver= "localhost";
$dbname= "";
$dbuser= "";
$dbpass= "";
mysql_connect($dbserver, $dbuser, $dbpass);
mysql_select_db($dbname);
$res = mysql_query("SELECT * FROM gaestebuch");
if($res)
{
echo "<table>\n";
while($row=mysql_fetch_array($res, MYSQL_ASSOC))
{
echo "<tr>";
for($a = 0; $a < mysql_num_fields($res); $a++)
echo "<td>" . $name[$a] . "" . $mail[$a] . "" . $homepage[$a] . "" . $message[$a] . "" . $date[$a] . "</td>";
echo "</tr>\n";
}
echo "</table>\n";
mysql_free_result($res);
}
mysql_error()
?>
Kommentar