Ich habe mir hier ein kleines Script erstellt, mit dem ich Gästebucheinträge ausgeben lassen will, aber wieso funktioniert die if-Anweisung am Ende des Scripts nicht?
PHP-Code:
<?php
$db = mysql_connect("localhost", "root", "");
$SQL_GBOOK = "SELECT * FROM bero_gbook WHERE gbook_pruef=1 ORDER BY gbook_id DESC";
$result = mysql_db_query("berti", $SQL_GBOOK);
while ($row = mysql_fetch_array($result)) {
extract($row);
echo "
<table class=\"ct\">
<tr>
<td style=\"text-align: left;\">$gbook_name</td>
<td style=\"text-align: right; font-weight: normal;\">$gbook_datum</td>
</tr>
</table>
<table class=\"it\">
<tr>
<td>$gbook_nachricht</td>
</tr>";
if($gbook_kommentar!='') {
echo "
<tr>
<td>$gbook_kommentar</td>
</tr>";
}
echo "</table>";
}
?>