The message board program needs to be implemented by php + database. This tutorial mainly talks about the implementation process of the php mysql message system, including adding, modifying, deleting and editing work. It is a good material for beginners of php.
Project structure:
Add page: Explanation: Only pay attention to the operation here, and there is no time for the artist of the interface. I hope everyone understands ...
List page:
Modify page:
The sql file of the message board can be directly imported into mysql
代码如下 | 复制代码 |
create database form; use form; 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 ; |
conn.php database connection file
The code is as follows | Copy code | ||||||||||||||||||||||||||||||||||||||
$conn = @ mysql_connect("localhost", "root", "") or die("Database link error");
mysql_query("set names 'gbk'");
list.php 以列表形式输出留言
PreEdit.php editing is to use update to update the data resubmitted by the user and replace the previous record with id as the unique identifier
?> mysql_query($query); ?> //Page jump, implemented by javascript $url = "list.php"; <🎜> echo ""; ?> Summary This is a complete message board system. As long as you save it as a file according to the above tips, you can effectively implement the message function. The message board mainly includes data reading, paging and data deletion and editing. We divide it into The three statements of sql delete, update, and insert are relatively basic knowledge. http://www.bkjia.com/PHPjc/631287.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/631287.htmlTechArticleThe message board program needs to be implemented by php + database. This tutorial mainly talks about the implementation of the php mysql message system. The process, including addition, modification, deletion and editing work, is suitable for beginners of PHP... |