Create database
Database structure
Create a new database
##Use sql statements to create tables.
##CREATE TABLE IF NOT EXISTS `user` (
`uid` int(10) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
`username` varchar(30) NOT NULL DEFAULT '' COMMENT '用户名',
`password` char(32) NOT NULL DEFAULT '' COMMENT '密码',
`sex` char(2) NOT NULL DEFAULT '保密' COMMENT '性别',
`email` varchar(40) NOT NULL DEFAULT '' COMMENT '邮箱',
`hobby` varchar(255) NOT NULL DEFAULT '' COMMENT '兴趣爱好',
PRIMARY KEY (`uid`),
KEY `username` (`username`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='用户表' AUTO_INCREMENT=17 ;
Create user table with 6 fields for storage
Then fill in the content fields.
INSERT INTO `user` (`uid`, `username`, `password`, `sex`, `email`, `hobby`) VALUES (1, 'apple', '123456', '女', 'apple@qq.com', '篮球'), (2, 'pkoce', '123123', '女', 'apple@qq.com', '足球'), (3, '李丽', '11315', '女', 'lili@qq.com', '篮球'), (4, '夏明', '741852', '男', 'weifei@qq.com', '排球'), (5, '陈正则', '123456', '男', 'liuliu@qq.com', '拍球'), (6, '源正真', '123456', '女', 'jkjkj@163.com', '篮球'), (7, '靖沛凝', '1256', '男', '11123@qq.com', '排球'), (8, '抗天心', '178976', '男', '412112@qq.com', '乒乓球'), (9, '赵英媛', '11597536', '女', '5155@qq.com', '篮球'), (10, '杨玟玉', '956235', '男', '568115@qq.com', '乒乓球'), (11, '李寄云', '741jiw', '女', '45158@qq.com', '篮球'), (12, '王二', 'hyytd', '男', '5484@qq.com', '篮球'), (13, 'arr', '46544', '女', '9825@qq.com', '足球'), (14, 'OOpple', '123456', '男', 'apple@qq.com', '排球'), (15, 'ccc', '123456', '女', 'apple@qq.com', '篮球'), (16, 'bibibi', '123456', '女', 'apple@qq.com', '足球');
In this way, our database form has been stored, and then we can learn to search.
Next Section