1. 打开数据库客户端,比如navicat,打开你服务器的数据库连接。
2. 新建查询-打开命令窗口,输入一下内容,替换里面的昵称 '问天' 为你自己的昵称,全选执行
use dj_game_cur;
set @char_name='问天';
select char_id into @char_id from game_sns_characters where char_name=@char_name;
select ranklist_id, char_id into @npc_rank, @npc_id from game_common_cloned_battle_ranklist where is_npc=1 ORDER BY ranklist_id desc limit 1;
select ranklist_id into @my_rank_id from game_common_cloned_battle_ranklist where char_id=@char_id;
update game_common_cloned_battle_ranklist set char_id=@char_id,is_npc=0 where ranklist_id=@npc_rank;
update game_common_cloned_battle_ranklist set char_id=@npc_id,is_npc=1 where ranklist_id=@my_rank_id;
select max(ranklist_id) into @max_rank_id from game_common_cloned_battle_ranklist;