OK. The problem is I don't want the next "highest" number.
There are gaps in the UID sequence. I need to find the next UNUSED
number in the sequence which is rarely the "highest" number.
Phone: (214) 858-1289
E-mail: [EMAIL PROTECTED]
From: Bastien Koert [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 05, 2004 12:45 PM
To: NIPP, SCOTT V (SBCSI); [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Auto-increment questions...
If its an autoincrement, the next highest number will be assigned by the
There is no need to query the db to find it. Simply insert the record
leave the id field out of the insert statement.
>From: "NIPP, SCOTT V (SBCSI)" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Subject: [PHP-DB] Auto-increment questions...
>Date: Tue, 5 Oct 2004 11:58:41 -0500
> 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
>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?
>Phone: (214) 858-1289
>E-mail: [EMAIL PROTECTED]
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
Scan and help eliminate destructive viruses from your inbound and
e-mail and attachments.
Start enjoying all the benefits of MSN(r) Premium right now and get
first two months FREE*.
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php