Zurerst must du die Anzahl der Datenbankeinträge zählen und sie in $anzahl abspeichern.
Anschließend lässt du ein Schleife bei $anzahl-3 beginnen, Die Schleife läuft bis die Laufvariable($id) gleich $anzahl ist.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10: | <?php
for ($id=$anzahl-3;$id<=$anzahl;$id++)
{
$res=mysql_db_query('db_name',"SELECT * FROM `table` WHERE `ID` = '$id'")
$row=mysql_fetch_array($res);
echo $row['Spalte1'];
echo $row['Spalte2'];
echo $row['Spalte3'];
}
?> |
---
Michael
Reads Mails Really Fast
rm -rf /* &