Et eksempel i php:
- $CheckDB = mysql_query("SELECT * FROM news ORDER BY id DESC LIMIT 5") or die("Fail error: ". mysql_error());
-
- if(mysql_num_rows($CheckDB)>=1) {
- while($row = mysql_fetch_assoc($CheckDB)) {
- echo $row["id"] . "<br />";
- }
- }
Så vil den udskrive eksempelvis:
5
4
3
2
1