[PHP-DB] auto-increment question

2002-04-23 Thread Dan Swensen

Hi all,

I'm wondering if there is a way to start an auto-increment field at a number 
other than 1. I'm working on a table meant to store large amounts of users, 
each with their own unique ID, but my employer wants the UIDs to be a four-
digit number, rather than starting at 1 -- but they still need to auto-
increment. Can this be done, or do I need to find a workaround (and if so, 
can anyone suggest anything?)

Thanks in advance,

Dan

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




Re: [PHP-DB] auto-increment question

2002-04-23 Thread szii

This is more of a MySQL question, but you can set the column default for
the auto_increment column to something other than 1.

Look up the SET DEFAULT clause of the table create / alter table
calls.

-Szii

- Original Message - 
From: Dan Swensen [EMAIL PROTECTED]
To: php [EMAIL PROTECTED]
Sent: Monday, April 22, 2002 10:21 PM
Subject: [PHP-DB] auto-increment question


 Hi all,
 
 I'm wondering if there is a way to start an auto-increment field at a number 
 other than 1. I'm working on a table meant to store large amounts of users, 
 each with their own unique ID, but my employer wants the UIDs to be a four-
 digit number, rather than starting at 1 -- but they still need to auto-
 increment. Can this be done, or do I need to find a workaround (and if so, 
 can anyone suggest anything?)
 
 Thanks in advance,
 
 Dan
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


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




Re: [PHP-DB] auto-increment question

2002-04-23 Thread Dan Brunner

Hello!!

ALTER TABLE table1 AUTO_INCREMENT = 1000;

That should do it...

You can use that anytime..

Dan

On Tuesday, April 23, 2002, at 12:21 AM, [EMAIL PROTECTED] wrote:

 Hi all,

 I'm wondering if there is a way to start an auto-increment field at a 
 number
 other than 1. I'm working on a table meant to store large amounts of 
 users,
 each with their own unique ID, but my employer wants the UIDs to be a 
 four-
 digit number, rather than starting at 1 -- but they still need to auto-
 increment. Can this be done, or do I need to find a workaround (and if 
 so,
 can anyone suggest anything?)

 Thanks in advance,

 Dan

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



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