PHP + MySQL to achieve the Message Board

Learn PHP for some time, and try to do a PHP + MySQL to make a login registration interface has a message board page, try to consider safety issues (anti-explosion, anti-implantation, anti-ultra vires)

build database

Do a database, I pondered it, do two tables, a "user" table two stores user information, username and password; another "Message" table three put Message, title, content, time
probably first made this

creat datdbase message_board;#创建数据库


use message_board;
creat table admin#创建用户表
(
id int auto_increment,
username varchar(50) not null;#创建容量为50的username列
password varchar(50) not null;#创建容量为50的password列
primary ker(id)
)
charset = utf8;


creat table meas#创建留言信息表
(
id int auto_increment comment 'id';#创建id列
title varchar(20) not null comment'标题';#创建容量为20的title表
content text not nullcomment'内容';#创建content表
addtime varchar(20) not null comment'时间';#创建容量为20的add time表
primary key(id)
)charset = utf8;

insert into admin values(defaulf,'admin','admin');#创建一个管理员用户
Released seven original articles · won praise 1 · views 2410

Guess you like

Origin blog.csdn.net/sevenlob/article/details/104269468