Re: getting lines from the highest ID in a database?
| From: | Jason Wong | Date: | Fri, 05 Apr 2002 10:36:08 +0000 |
| Subject: | Re: getting lines from the highest ID in a database? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-91679@lists.php.net to get a copy of this message | ||
On Friday 05 April 2002 18:27, Hawk wrote:
> Lets say I have a guestbook, and that I only want to show the last entry on
> my first page
> I cant figure out a good way to do it..
> haven't managed to find a mysql command that can do it either, but maybe
> there are? :)
The only reliable way to do it is to have a field in your guestbook table
which records the time that the entry was made. Then you can:
SELECT * FROM guestbook ORDER BY time_entered LIMIT 1
I have set follow-up to php-db@lists.php.net where this belongs.
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
/*
If there is any realistic deterrent to marriage, it's the fact that you
can't afford divorce.
-- Jack Nicholson
*/