Auto-increment questions...
| From: | NIPP, SCOTT V \(SBCSI\) | Date: | Tue, 05 Oct 2004 16:58:41 +0000 |
| Subject: | Auto-increment questions... | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-36615@lists.php.net to get a copy of this message | ||
I am working on a database application for Unix user accounts.
I want to be able to have a system that will provide me the next
available numeric user ID. I have created a 2 column index table that
simply includes UID and user name. This field is autoincrement and the
primary key for the table. Currently this field only contains a very
small sample of users. Basically, I have numeric IDs 3000, 3001, 3008,
and 3028. My problem is that I am not sure how to query this table to
get the next available numeric ID which is 3002. If I do an insert into
this table without specifying a value for the auto_increment column it
comes up with 3029. Is there a way to query and/or insert such that it
comes up with the next unused numeric value?
Scott Nipp
Phone: (214) 858-1289
E-mail: sn4265@sbc.com
Web: http:\\ldsa.sbcld.sbc.com