Jump to content

need help - odd php script - mysql update


carlosp

Recommended Posts

i need to create a script which update the mysql records

 

i have this table

ID                   CODE
1000                 abcd
1001                 abcd
1002                 abcd
1003                 abcd
1004                 abcd
.......
1049                 abcd
1050                 qwer
1051                 qwer
1052                 qwer
1053                 qwer
.......
1098                 qwer
1099                 qwer
1100                 38xs
......
17037                djaso
17038                djaso

i need to update only the IDs. There are like 25.000 rows in this table, the IDs are not all sequential (1,2,3,6...49,80,81...129,283,284...24800,24801...24810,25000) then the ID's will start from last ID+1 (25001)

 

each CODE is present in this table 50 times and the IDs corresponding to each code are sequential

 

How can i do that?

 

Thank you!

Link to comment
https://forums.phpfreaks.com/topic/276746-need-help-odd-php-script-mysql-update/
Share on other sites

IDs are unique identifiers for rows within a table and their sequence should be of no relevance to your application. The application should work the same way even if these unique ids were generated randomly rather sequentially. Sometimes I wish they were so people wouldn't have hangups about gaps in id sequences.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.