ALTER TABLE `wp_[TABLE_NAME]` ADD `n_[FIELD_ID]` tinyint(4) NULL; ALTER TABLE `wp_[TABLE_NAME]` ADD `n_[FIELD_ID]_distance` int NULL; ALTER TABLE `wp_[TABLE_NAME]` ADD `n_[FIELD_ID]_distance_by` tinyint(4) NULL; UPDATE `wp_wpl_dbst` SET `table_name`='[TABLE_NAME]', `table_column`='n_[FIELD_ID]' WHERE id=[FIELD_ID];