Is there anyway of selecting all from a table except the last 10 records ordered by date desc?
I thought about one query to get the last 10 ids, then inserting that into a second query but I am not sure how to do it..
Example:
$nresult = mysql_query("SELECT id FROM `news` ORDER BY date DESC LIMIT 5");
while ($row=mysql_fetch_array( $nresult )):
$id = "'".$row[0]."'";
Then insert into second as $news -this is what I am stuck on !
$anresult = mysql_query("SELECT id, date, user, subject, content FROM `news`WHERE id NOT IN ($news) ORDER BY date DESC");
Aditional info:
ID is autoincremental.
I have been looking at the manual and substr("$news", 0, -1) takes off one character in every occurent of the id..
Any advice / comments / solutions really welcomed :p
It is driving me nuts :mad:
Br
Jamie