desc: category mod/ed referenced by id table: change moderator moderator_handle varchar(32), + change editor editor_handle varchar(32) table: add moderator int(11) unsigned not null, + add editor int(11) unsigned not null [loop: (uid, uhandle) select distinct u.id, u.handle + from users u, category c + where u.handle = c.moderator_handle or u.handle = c.editor_handle pop: update category set moderator = *uid where moderator_handle = *uhandle pop: update category set editor = *uid where editor_handle = *uhandle ] table: drop moderator_handle, drop editor_handle