后台地图>执行SQL
mdb:
../db/user.db3 SQL:
select * from user where name='大老虎' #查看指定用户的信息
update user set name='小老虎' where name='大老虎' #为指定用户改名
update user set pass=md5('我的密码') where name='悲剧帝' #给指定用户改密码
select uid from user where name='嘿嘿'#查看指定用户的uid
select count(*) from user #查看注册用户总数
select * from user limit 0,20 #查看第1~20个用户的信息。改成limit 20,20,查看第21~40个用户的信息。语法:limit 开始位置,条数
select uid,name,qianm,lianx from user where name like '%龙%' #查找用户名中含“龙”的所有用户
mdb:
../db/bbs.db3 SQL:
select * from bk #查看版块
insert into bk(name,bzid) values('版块名称', ',1,2,1008,…更多版主uid…,') #新建版块。注意版主uid以逗号开始结束,逗号分隔。得到uid的方法是查询user.db3
update bk set name='新名' where name='老名'或
update bk set name='新名' where id=5 #版块改名。5是版块id,查看版块时可以看到
delete from bk where name='版名' #删版。同上,可以用where id=版块id
update bk set bzid=',1,5,7,1390,1101,' where id=6 #重设版主。可以用name='…'。如果去掉where及后面的内容,就是重设所有版的版主
update bk set bzid=bzid || '1353,' where id=3 #添加版主。可以改成name=。去年where和后面的内容(称为where子句)可以添加总版主。逗号不能少。
update bk set bzid=replace(bzid, ',1353,' , ',1585,') where id=3 #替换版主。可以用where name=,以后不赘述。
update tz set ztn='[顶]', youxian=2 where id=565 #置顶贴子。565是贴子id,查看方法是:贴子页存书签,看tzid=
update tz set bkid=2 where id=335 #移版
update tz set ztn='[精]' where id=565 #加精贴子。
update tz set ztn='[锁]', extra='锁贴原因' where id=565 #锁定贴子。
update tz set ztn='[底]', youxian=0 where id=565 #固底贴子。
delete from tz where uid=5 #删除指定用户的贴子。
delete from tz where id>565 and id<575 #删除id在指定范围内的贴子。
delete from tz where id in(1001, 3553, 7717) #指定多个id删贴。
update tz set fttime=fttime-36000, hftime=hftime-36000 where id>565 and id<575 #把id在指定范围内的贴子从首页移下(原理:把贴子的发贴时间提前36000秒,它们就会被之后的贴子顶下去)。