finding the highest primary key in a table
| From: | Phil Schwarzmann | Date: | Tue, 25 Jun 2002 00:53:46 +0000 |
| Subject: | finding the highest primary key in a table | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-103706@lists.php.net to get a copy of this message | ||
I want to find the number of the highest primary key in a particular
MySQL table.
I could do something like...
$query = "SELECT id FROM table";
...then run the query, then create a loop and check all the ID's
(primary key) for the highest...
...but that seems like way too much.
Any ideas ??