All posts
Synced from Juejin2021-02-253 min read

PHP+MySql+PDO小案例—文章管理系统

先附上整体效果 目录结构 数据库名itcast , 表名cms\ article 表名cms\ category 附源码下载链接 download.csdn.net/download/we…

SynopsisThis post is preserved inside the rebuilt blog shell while keeping the original Chinese content intact.Original source

先附上整体效果

在这里插入图片描述

目录结构

在这里插入图片描述

数据库名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&nbsp; &nbsp; &nbsp; &nbsp;</p><p>请在这里编写文章……</p><p>\r\n\t\t\t</p>','魁首','2019-06-05 09:19:45',1),(17,'Java','<p>\t\t\t\t&nbsp; &nbsp; &nbsp; &nbsp;</p><p>请在这里编写文章……</p><p>\r\n\t\t\t</p>','魁首','2019-06-05 09:20:01',1),(20,'C#','<p>\t\t\t\t&nbsp; &nbsp; &nbsp; &nbsp;</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);

附源码下载链接

download.csdn.net/download/we…