Re: Selecting number of news items on frontpage

From: Date: Thu, 01 Mar 2001 01:23:40 +0000
Subject: Re: Selecting number of news items on frontpage
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-7031@lists.php.net to get a copy of this message
You could then issue as select statement like " select * from articles limit 7 order by nArticleKey descending" (maybe it should be "top" instead of "limit", check your MySLQ syntax) and feed those to the front page.
select * from articles order by nArticleKey desc limit 7 although a better way would be to include a date stamp on the article (which i see you already have, and assuming you have done it in mysql friendly - "Y-m-d H:i:s" then you can do this and get them in reverse chronological order (newest article first) select * from articles order by date desc limit 7 and on the "archive page" select * from articles order by date desc limit ,7 or something like that, see the mysql documentation under the select syntax

« previous php.db (#7031) next »