先附上整体效果
目录结构
数据库名itcast , 表名cms_article
DROP TABLE IF EXISTS `cms_article`;
CREATE TABLE `cms_article` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL COMMENT '文章标题',
`content` text NOT NULL COMMENT '文章内容',
`author` varchar(255) NOT NULL COMMENT '作者',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
`cid` int(10) unsigned NOT NULL COMMENT '文章所属分类',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=22 DEFAULT CHARSET=utf8;
INSERT INTO `cms_article` VALUES (16,'PHP','<p>\t\t\t\t </p><p>请在这里编写文章……</p><p>\r\n\t\t\t</p>','魁首','2019-06-05 09:19:45',1),(17,'Java','<p>\t\t\t\t </p><p>请在这里编写文章……</p><p>\r\n\t\t\t</p>','魁首','2019-06-05 09:20:01',1),(20,'C#','<p>\t\t\t\t </p><p>请在这里编写文章……</p><p>\r\n\t\t\t</p>','魁首','2019-06-05 09:22:07',1);表名cms_category
DROP TABLE IF EXISTS `cms_category`;
CREATE TABLE `cms_category` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL COMMENT '分类名称',
`sort` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=15 DEFAULT CHARSET=utf8;
INSERT INTO `cms_category` VALUES (1,'PHP',0),(2,'Java',0),(4,'C/C++',1),(10,'python',2),(13,'JQuery',0);附源码下载链接
<a
href="https://link.juejin.cn?target=https%3A%2F%2Fdownload.csdn.net%2Fdownload%2Fweixin_44019370%2F11230437" data-ref="nofollow noopener noreferrer" target="_blank" title="https://download.csdn.net/download/weixin_44019370/11230437">download.csdn.net/download/we…