This section to add some test data to the database.
Log in to MySQL:
Locate the%xampp%\mysql\bin directory,
Open a command window here to log in to MySQL with the root user
User table-built table sql:
CREATE TABLE tm_users
(
id
Int (one) not NULL auto_increment,
username
varchar (255) CHARACTER SET UTF8 DEFAULT NULL,
password
varchar (255) DEFAULT NULL,
nickname
varchar (255) CHARACTER SET UTF8 DEFAULT NULL,
createtime
DateTime DEFAULT NULL,
updatetime
DateTime DEFAULT NULL,
isdelete
varchar (255) DEFAULT NULL,
PRIMARY KEY ( id
)
) Engine=innodb auto_increment=14 DEFAULT Charset=utf8;
Copy it in, enter.
This means that the building is ready.
The Department table is the same.
The Department table builds the table sql:
CREATE TABLE tm_dept
(
id
Int (one) not NULL auto_increment COMMENT ' primary key ',
deptid
varchar (one) DEFAULT NULL COMMENT ' Department number (format bm_001) ',
deptname
varchar (255) DEFAULT NULL COMMENT ' Department name ',
createtime
DateTime DEFAULT NULL COMMENT ' creation time ',
updatetime
DateTime DEFAULT NULL COMMENT ' Last update Time ',
PRIMARY KEY ( id
)
) Engine=innodb auto_increment=6 DEFAULT Charset=utf8;
Test data:
INSERT into tm_dept
VALUES (' 6 ', ' bm_001 ', ' Ministry of Science ', ' 2018-04-17 13:50:21 ', ' 2018-04-17 13:50:21 ') ;
INSERT into tm_dept
VALUES (' 7 ', ' bm_002 ', ' Finance department ', ' 2018-04-17 13:50:59 ', ' 2018-04-17 13:50:59 ');
INSERT into tm_dept
VALUES (' 8 ', ' bm_003 ', ' Cooking department ', ' 2018-04-17 13:51:05 ', ' 2018-04-17 13:51:05 ');
INSERT into tm_dept
VALUES (' 9 ', ' bm_004 ', ' Test Department ', ' 2018-04-17 13:51:09 ', ' 2018-04-17 13:51:09 ');
INSERT into tm_dept
VALUES (' Ten ', ' bm_005 ', ' development department ', ' 2018-04-17 13:51:14 ', ' 2018-04-17 13:51:14 ');
INSERT into tm_dept
VALUES (' One ', ' bm_006 ', ' production department ', ' 2018-04-17 13:51:19 ', ' 2018-04-17 13:51:19 ');
INSERT into tm_users
VALUES (' + ', ' zhangsan ', ' 123 ', ' Zhang San ', ' 2018-04-17 13:48:31 ', ' 2018-04-17 13:48:31 ', ' 0 ');
INSERT into tm_users
VALUES (' Lisi ', ' 123 ', ' John Doe ', ' 2018-04-17 13:48:52 ', ' 2018-04-17 13:48:52 ', ' 0 ');
INSERT into tm_users
VALUES (' + ', ' Wangwu ', ' 123 ', ' Harry ', ' 2018-04-17 13:49:01 ', ' 2018-04-17 13:49:01 ', ' 0 ');
Anyway, just copy it in.
"PHP additions and Deletions Example" section III-MySQL build table