Re: MySQL question
| From: | David Robley | Date: | Thu, 06 Jul 2000 05:51:59 +0000 |
| Subject: | Re: MySQL question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-5165@lists.php.net to get a copy of this message | ||
On 6 Jul, Tyler Longren wrote:
>
> Howdy List-
>
> How can I get the 20 most recent additions to a MySQL db? I am logging
> certain info about visitors to the database and want to be able to display
> a bit of info about the last 20 visitors. How can I do this? Should there
> be some sort of unique ID for every entry?
>
> Regards,
> Tyler
>
>
If you have a field that you can sort on that reflects the order of
adding, then you could sort by that field, descending, and use LIMIT to
limit the number of results returned.
Cheers
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA