Frage zur Ausgabe von DB?!

medico

Erfahrenes Mitglied
Hallo,
ich möchte die letzten 5 Einträge aus meiner DB ausgeben lassen, das klappt auch schon.
Ich lasse die Daten in einer Tabelle ausgeben und unter jedem Datensatz habe ich eine Horizontalelinie, sieht auch gut aus.
Nur soll sie unter dem letztem Datensatz nicht erscheinen. Wie stelle ich das an?

Hier mal mein Code der die Daten in die Tabelle ausgibt:
PHP:
<table width="100%"  border="0" cellspacing="0" cellpadding="0"><? while ($daten = mysql_fetch_array($result)) { ?>
                    <tr>
                      <td width="80">&nbsp;</td>
                      <td width="10">&nbsp;</td>
                      <td valign="top">&nbsp;</td>
                    </tr>
                    <tr>
                      <td width="80"><img src="upload/pn/<? echo $daten[bild1]; ?>"></td>
                      <td width="10">&nbsp;</td>
                      <td valign="top"><table width="100%" height="83"  border="0" cellpadding="0" cellspacing="0">
                        <tr>
                          <td valign="top" class="kontakt_uber"><? echo $daten[uberschrift]; ?></td>
                        </tr>
                        <tr>
                          <td valign="bottom"><a href="pn.php?id=<? echo $daten[id]; ?>">weiter &raquo;</a></td>
                        </tr>
                      </table></td>
                    </tr>
                    <tr>
                      <td colspan="3"><hr size="1"></td>
                      </tr><? } ?>
                  </table>

Gruß Medi
 
Ist zwar nich gerad sehr schön der code....aber er dürfte so in etwa funktionieren:
PHP:
<?
$i=0;
?>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
<? while ($daten = mysql_fetch_array($result)) { ?> 
                    <tr> 
                      <td width="80">&nbsp;</td> 
                      <td width="10">&nbsp;</td> 
                      <td valign="top">&nbsp;</td> 
                    </tr> 
                    <tr> 
                      <td width="80"><img src="upload/pn/<? echo $daten[bild1]; ?>"></td> 
                      <td width="10">&nbsp;</td> 
                      <td valign="top"><table width="100%" height="83"  border="0" cellpadding="0" cellspacing="0"> 
                        <tr> 
                          <td valign="top" class="kontakt_uber"><? echo $daten[uberschrift]; ?></td> 
                        </tr> 
                        <tr> 
                          <td valign="bottom"><a href="pn.php?id=<? echo $daten[id]; ?>">weiter &raquo;</a></td> 
                        </tr> 
                      </table></td> 
                    </tr> 
                    <tr> 
		    <?
		    if($i<5)
		    {
                     echo"<td colspan=\"3\"><hr size=\"1\"></td> ";
		     $i++;
		     }
		     ?>
                      </tr><? } ?> 
                  </table>
 
Zurück