Creation of new...LOGIN

Creation of news classification table for PHP native development news station

In our previous courses, we have completed the addition, deletion, modification and checking of news, as well as the paging function. In the previous news modifications and additions, we all mentioned news classification, so in this section we At the beginning of the class, I will introduce news classification to you!

First we open the phpmyadmin graphical management tool, find the project database, and create a data table. Our news category is named: new_category. What we do is the simplest classification, which is the first-level classification, so we only Two fields are required, one id and one name!

1744.png

Then we insert some data into the database:

1745.png

At this point our news classification data table is created!

Next Section
<?php //建库语句是 create database 数据库名; //建表语句是: create table 数据表名( id INT(4) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号', name VARCHAR(50) NOT NULL COMMENT '分类名', )ENGINE = MyISAM DEFAULT CHARSET = utf8 AUTO_INCREMENT = 1001;"; //仅供参考; ?>
submitReset Code
ChapterCourseware