Re: Finding highest number in auto increment

From: Date: Tue, 09 Apr 2002 12:51:56 +0000
Subject: Re: Finding highest number in auto increment
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-18351@lists.php.net to get a copy of this message
Oh, forget to include that if you only want that one record, use the "LIMIT 1" keyword as well. Adam Voigt adam.voigt@cryptocomm.com P.S.: All of this is in the MySQL manual. On Tue, 09 Apr 2002 15:48:45 +0200, Lisi <lists@shemeshdirectory.co.il> wrote: > Each record in my table has a unique ID number generated by auto increment > each time a new record is added. This is stored in a field called ID. I > have a page that displays records as they are selected, but I want the > default to be the latest entry if none has been selected. > > How do I write the query to find the highest number an display that record? > > It should be something like this I think: > > SELECT organization FROM ayny WHERE ID ... > > how does this end? > > Thanks, > > -Lisi > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.db (#18351) next »