$query = "SELECT max(id) FROM table";

-----Original Message-----
From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 25, 2002 10:54 AM
To: [EMAIL PROTECTED]
Subject: [PHP] finding the highest primary key in a table


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 ??

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to