Hi, I've got a news script which posts al the news, starting with the newest one. My question is how to post only the 10 most recent newsitems on the main page, and all the others on the archives page ? The problem is that i can only work with the posting date to do this, cause there's no ID# in the database. So i need to know how i can manipulate the lines to look at the date before posting and act accordingly to date:
<?
$result=mysql($database,"select * from news order by datum desc"
while ($row = mysql_fetch_array($result)) {
$datum = date("d-m-Y", $row[datum]);
print '<table width="550" border="0" cellspacing="0" cellpadding="0" align="center"><tr>';
print '<td width="37"><img src="images/title_links.jpg" width="37" height="50"></td>';
print '<td width="390" background="images/title_midden.jpg">';
printf ("<font size=-1><a name=\"%s\"> %s</a></font>",$row[title],$row[title]);
print '<td width="86" background="images/title_midden.jpg">';
printf ("<font size=-2> $datum</font></td>",$row[title]);
print '<td width="37"><img src="images/title_rechts.jpg"></td><tr><br>';
print '<table width="450" border="0" cellspacing="0" cellpadding="0" align="center"><tr>';
printf ("<br><font size=-1> %s </a></font><br><br>",$row[itemtext]);
printf ("<font size=-2><p>By %s <p></a></font><br><br>",$row[postername]);
}
?>
Can you pls help me ?
thx in advance.
Raven
<?
$result=mysql($database,"select * from news order by datum desc"
while ($row = mysql_fetch_array($result)) {
$datum = date("d-m-Y", $row[datum]);
print '<table width="550" border="0" cellspacing="0" cellpadding="0" align="center"><tr>';
print '<td width="37"><img src="images/title_links.jpg" width="37" height="50"></td>';
print '<td width="390" background="images/title_midden.jpg">';
printf ("<font size=-1><a name=\"%s\"> %s</a></font>",$row[title],$row[title]);
print '<td width="86" background="images/title_midden.jpg">';
printf ("<font size=-2> $datum</font></td>",$row[title]);
print '<td width="37"><img src="images/title_rechts.jpg"></td><tr><br>';
print '<table width="450" border="0" cellspacing="0" cellpadding="0" align="center"><tr>';
printf ("<br><font size=-1> %s </a></font><br><br>",$row[itemtext]);
printf ("<font size=-2><p>By %s <p></a></font><br><br>",$row[postername]);
}
?>
Can you pls help me ?
thx in advance.
Raven