数据库表设计
mysql> create database box_man; #创建数据库box_man
mysql>
mysql> create table users( #创建用户表
id int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
username varchar(64) NOT NULL UNIQUE,
password varchar(32) NOT NULL ,
level_id int default 1
);
mysql> create table levels( #创建关卡表
id int NOT NULL PRIMARY KEY default 1,
name varchar(64) NOT NULL UNIQUE,
map_row int NOT NULL,
map_column int NOT NULL,
map_data varchar(4096) NOT NULL,
next_level_id int default 0
);
mysql> insert into users values(1000, 'martin', md5('123456qweQWE'), 1);
mysql> insert into levels values(1, '牛刀小试', 9, 12,
'0,0,0,0,0,0,0,0,0,0,0,0|0,1,0,1,1,1,1,1,1,1,0,0|0,1,4,1,0,2,1,0,2,1,0,0|0,1,0,1,0,1,0,0,1,1,1,0|0,1,0,2,
0,1,1,4,1,1,1,0|0,1,1,1,0,3,1,1,1,4,1,0|0,1,2,1,1,4,1,1,1,1,1,0|0,1,0,0,1,0,1,1,0,0,1,0|0,0,0,0,0,0,0,0,0,0,
0,0',0);
具体操作
结语:
时间: 2020-07-15