Construction of database for php development message board

Building the database

First of all, novice friends can use phpmyadmin to create a message board registration table to store data. The database statements are given below. Just create a table on the left side

QQ截图20161025114719.png


Then enter the sql statement

QQ截图20161025114726.png

CREATE TABLE `message` (
  `id` tinyint(1) NOT NULL auto_increment,
  `user` varchar(25) NOT NULL,
  `title` varchar(50) NOT NULL,
  `content` tinytext NOT NULL,
  `lastdate` timestamp NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

The meaning of the above statement is that the table name message

ID incrementing function

user is used to store the user name character length 25

title is used To store the title Character length 50

Content Content Enter text

lastdate Time Store the time when the message was published

PRIMARY KEY (`id`) Primary key id is used as the primary key

ENGINE=InnoDB storage engine is innodb

DEFAULT CHARSET=utf8 Set the character to utf8

AUTO_INCREMENT=1; Automatically grow 1

The table is set as follows

QQ截图20161025114855.png


Create the required PHP files

add.html Comment page

add.php Submits the content transferred from the comment page to the database.

conn.php Configuration file for connecting data

css.css File beautification html style

del.php Delete comment file

list.php Obtain database All data is displayed on the page.

Continuing Learning
||
CREATE TABLE `message` ( `id` tinyint(1) NOT NULL auto_increment, `user` varchar(25) NOT NULL, `title` varchar(50) NOT NULL, `content` tinytext NOT NULL, `lastdate` timestamp NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
submitReset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!