Hello,
I want to add a box to the main page of my site, so everybody can see what the latest additions are. I already have a good script that lists all entries. My problem is that I don't know how to limit the entries shown, to let's say 10 results.
Can anybody tell me how to make a good script or how to modify my current script so it will show only the latest 10 results?
Listing script:
<?php
require "ezine_db.inc.php";
$ezine_db = ezine_connecte_db();
$str_requete = "SELECT id,stof,auteur,grootte,vak FROM artikel WHERE affichage='$affichage' ORDER BY date DESC";
$result_articles = mysql_query ($str_requete,$ezine_db) or ezine_mysql_die();
print ('<center><table border="1" cellspacing="0">');
print("
<tr>
<td><center><b>Vak</b></td>
<td><center><b>Stof</b></td>
<td><center><B>Auteur</B></td>
<td><center><b>Grootte</b></td>
<td><center><b>Download Link</b></td>
</tr>
");
while ($articleDb =mysql_fetch_object($result_articles))
{
print("
<tr>
<td><center>$articleDb->vak</td>
<td><center>$articleDb->stof</td>
<td><center>$articleDb->auteur</td>
<td><center>$articleDb->grootte</td>
<td><center><a href='download.php?id=$articleDb->id'>Download nu!</a></td>
</tr>
");
}
print ('</table></center>');
?>
Thanx in advance