Forum Moderators: open

Message Too Old, No Replies

rebuilding incremental data

how do I tell mysql to populate the field?

         

Dragonmom

3:46 am on Mar 3, 2008 (gmt 0)

10+ Year Member



I am migrating from oscommerce to zen cart. I want to migrate my orders information along with my products and thus far it's been easy if time consuming-- I upload the oscommerce table and alter it to match the zencart one. But now I'm stumped.

One table has a id field that OSC doesn't have. I added the feild, and now I need to populate it retroactively with new id numbers-- over 600 of them. I am sure there's a way to tell mysql to do this for me-- Can anyone help me?

I am using MySQL client version: 4.1.10 I know it's old...

Thanks in advance...

[edited by: Dragonmom at 3:52 am (utc) on Mar. 3, 2008]

wheelie34

10:27 am on Mar 3, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If I understand you correct, I would drop the ID field and re-add it again making it an auto increment so it adds the numbers.

HTH

Dragonmom

7:45 pm on Mar 3, 2008 (gmt 0)

10+ Year Member



Are you saying that I can add the field already populated with the new ID numbers?

When I added the field, it populated with 0 for every row...

wheelie34

8:37 am on Mar 4, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



yes, I had the same problem a while back where the ID column was getting longer numbers and wanted to restart it at 1 so, somewhere on webmasterworld I read to drop it and re-add it, but remember the column MUST be auto increment or you will get 0's like you did.