user1427930
user1427930

Reputation: 119

Update/Change all ID in PhpMyAdmin (MySQL)

I've got a problem with a Joomla migration (Kunena forum component) When I try to copy the old forum table to the new one, I receive "Duplicate error" message.

A simple solution must be to change all the values in the ID column.

The table now:

id |   name

1  | Foo

2  | Bar

etc...

Can I add the numbers "20" for every rows? So the result will be:

id  |   name

201 | Foo

202 | Bar

etc...

Thanks!

Upvotes: 0

Views: 1731

Answers (1)

Eternal1
Eternal1

Reputation: 5625

UPDATE `table` SET `id` = CONCAT('20', `id`);

Upvotes: 2

Related Questions