This article provides php beginners with an article from database creation to the final process of reading and writing message boards. For more information, see. the code for creating a data table instance is as follows: CREATETABLE 'Mes... this article provides php beginners with an article from database creation to the final process of reading and writing message boards. For more information, see.
The code for creating a data table instance is as follows:
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` date NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=gbk AUTO_INCREMENT=1 ;
Database Connection file database connection code is relatively fixed. first create a new conn. php file and enter the following code:
The instance code is as follows:
Write the add. php file on the posting page and enter the following code:
The instance code is as follows:
Post message box
Write the message list file to create the file list. php, and enter the following code:
The instance code is as follows:
| Title:
User:
|
| Published content:
|
Note: this is only an entry-level php Tutorial. if you want to use it for the network, please perform some security and SQL injection filtering. Otherwise, it will be very insecure.
Tutorial link:
Reprint at will ~ However, please keep the tutorial address★