Re: [PHP-DB] mysql auto increment
I've done exactly this for a really cheap-and-dirty instance where two people were doing bulk data entry into two different instances of a mysql table which would eventually be stitched together. by giving one a higher range, the data migration afterwords was very easy. Other than that, can't imagine a use for this approach. -P -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysql auto increment
There might be some system that requires a 4 digit number and the PK is being used directly. Also, this same system might need to be exported to Excel, which trims leading zeros and is generally a pain in the ass. Peter Westergaard wrote: I've done exactly this for a really cheap-and-dirty instance where two people were doing bulk data entry into two different instances of a mysql table which would eventually be stitched together. by giving one a higher range, the data migration afterwords was very easy. Other than that, can't imagine a use for this approach. -P -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] mysql auto increment
Hello, I know this is more of a mysql question then php with mysql but I can not find the answer. I have a primary key in a table the is setup and working with auto increment. Now I want to change it so it will start auto incrementing from 1000. So each entry will be: 1001, then 1002, -- Michael Gale Network Administrator Utilitran Corporation -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysql auto increment
Michael Gale wrote: I know this is more of a mysql question then php with mysql but I can not find the answer. I have a primary key in a table the is setup and working with auto increment. Now I want to change it so it will start auto incrementing from 1000. So each entry will be: First of all, why? There's no reason to do this. Second, this link was just posted an hour ago or so. Check it out. http://dev.mysql.com/doc/mysql/en/example-AUTO_INCREMENT.html -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysql auto increment
On Tuesday 13 July 2004 07:19, Michael Gale wrote: I know this is more of a mysql question then php with mysql but I can not find the answer. www.mysql.com search auto increment http://dev.mysql.com/doc/mysql/en/CREATE_TABLE.html Keep reading and re-reading that page until you have your answer or ask on the mysql mailing list. I have a primary key in a table the is setup and working with auto increment. Now I want to change it so it will start auto incrementing from 1000. So each entry will be: 1001, then 1002, -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-db -- /* Average temperature increases with the amount of clothing brought -- Murphy's Laws of Camping n10 */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysql auto increment
I just had a bit of a play with it and discovered you can do this: say your auto-increment index is named 'fred' for arguments sake. INSERT INTO table SET FRED = 1000 This will just create a record where the auto-index fred will equal 1000. Next auto-increment, NOT specifying a value for 'fred', will be 1001. No idea if there are any dangerous side-effects. Perhaps others will know? At 09:19 AM 13/07/2004, you wrote: Hello, I know this is more of a mysql question then php with mysql but I can not find the answer. I have a primary key in a table the is setup and working with auto increment. Now I want to change it so it will start auto incrementing from 1000. So each entry will be: 1001, then 1002, -- Michael Gale Network Administrator Utilitran Corporation -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php . . Ross Honniball. JCU Bookshop Cairns, Qld, Australia. . -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] MySQL auto-increment problems
I have approx 160 rows in a table with an ID column set to auto increment. I have not changed anything suddenly one day the auto increment went from 162 to 2,145,694,203 I am running a Win 2000 box with IIS 5. any ideas? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php