亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Create databases and tables for background content page display tables and classifications

Earlier we created the vidoe database and created the administrator login form.

Now that we are going to start implementing the functions of the main page, we need to create a table for managing content and a table for managing categories.

First create a content management table: list Table

Set the following fields:

id: It is unique, type is int, and Select the primary key.

name: Video name, type is varchar, length is 20.

title: Video introduction, type is varchar, length is 200.

video: Video, type is varchar, length is 100.

time: Timestamp, type is int, length is 20.

cate_id: Category id, type is int, length is 10.

<?php
$SQL = " CREATE TABLE IF NOT EXISTS `list` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `name` varchar(20) NOT NULL,
  `title` varchar(200) NOT NULL,
  `video` varchar(100) NOT NULL COMMENT '視頻存放路徑',
  `time` int(20) NOT NULL COMMENT '視頻上架時間',
  `cate_id` int(10) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=45 DEFAULT CHARSET=utf8 COMMENT='視頻展示表'";
?>

Create a classification table: cate Table

Set the following fields:

id: It is unique, type is int, and Select the primary key.

pid: Parent class id, type is int, length is 10.

cate_name: Category name, type is varchar, length is 30.

rank: Classification level, type is int, length is 10.

<?php
$SQL = " CREATE TABLE IF NOT EXISTS `cate` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `pid` int(10) NOT NULL COMMENT '父類id',
  `cate_name` varchar(30) NOT NULL,
  `rank` int(10) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COMMENT='分類表'";
?>


Continuing Learning
||
<?php $SQL = " CREATE TABLE IF NOT EXISTS `cate` ( `id` int(10) NOT NULL AUTO_INCREMENT, `pid` int(10) NOT NULL COMMENT '父類id', `cate_name` varchar(30) NOT NULL, `rank` int(10) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COMMENT='分類表'"; ?>
submitReset Code