Re: news site, recent entries retrieval
| From: | Chris Hewitt | Date: | Wed, 13 Nov 2002 17:21:33 +0000 |
| Subject: | Re: news site, recent entries retrieval | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-124249@lists.php.net to get a copy of this message | ||
Pag wrote:
If your table is called mynews and it has a field called timestamp which contains the date/time the entry was made and you wanted the 10 most recent items of type 2, most recent first: select * from mynews where type = 2 limit 10 order by timestamp desc; Untested, but I think the syntax for MySQL is correct. Check in the MySQL manual if its not. Really a mysql list question. HTH ChrisOne of the fields in my tables is "type" (values 0, 1, 2 etc), which divides the news into categories, how can i display like the 10 most recent entries of type = 2, for example?