[PHP] finding the highest primary key in a table

2002-06-24 Thread Phil Schwarzmann
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 ??

RE: [PHP] finding the highest primary key in a table

2002-06-24 Thread Martin Towell
$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

RE: [PHP] finding the highest primary key in a table

2002-06-24 Thread John Holmes
I want to find the number of the highest primary key in a particular MySQL table. SELECT MAX(ID) FROM table Can you tell us why you need to do this? I have a feeling you're doing something bad... ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: