实现php后台安装数据库等一些操作,代码简单的写的。很多东西还不完善,请大家多多支持,意见可以写在评论中。
install.---------------------------------------------------------------------------
---------------------------------------------------------------------------
testdata.sql-- 创建数据库
CREATE DATABASE IF NOT EXISTS cute;
-- **
-- 使用此数据库
use cute;
-- **
-- 创建User表
CREATE TABLE IF NOT EXISTS cute_user (
`id` smallint(10) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(30) NOT NULL,
`headpic` varchar(100) DEFAULT null,
`password` varchar(30) NOT NULL,
`status` tinyint(10) NOT NULL DEFAULT 1,
`remark` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- **
-- 创建访问权限表
CREATE TABLE IF NOT EXISTS `cute_access` (
`role_id` smallint(6) unsigned NOT NULL,
`node_id` smallint(6) unsigned NOT NULL,
`level` tinyint(1) NOT NULL,
`module` varchar(50) DEFAULT NULL,
KEY `groupId` (`role_id`),
KEY `nodeId` (`node_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- **
CREATE TABLE IF NOT EXISTS `cute_node` (
`id` smallint(6) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(20) NOT NULL,
`title` varchar(50) DEFAULT NULL,
`status` tinyint(1) DEFAULT '0',
`remark` varchar(255) DEFAULT NULL,
`sort` smallint(6) unsigned DEFAULT NULL,
`pid` smallint(6) unsigned NOT NULL,
`level` tinyint(1) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `level` (`level`),
KEY `pid` (`pid`),
KEY `status` (`status`),
KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- **
CREATE TABLE IF NOT EXISTS `cute_role` (
`id` smallint(6) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(20) NOT NULL,
`pid` smallint(6) DEFAULT NULL,
`status` tinyint(1) unsigned DEFAULT NULL,
`remark` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `pid` (`pid`),
KEY `status` (`status`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
-- **
CREATE TABLE IF NOT EXISTS `cute_role_user` (
`role_id` mediumint(9) unsigned DEFAULT NULL,
`user_id` char(32) DEFAULT NULL,
KEY `group_id` (`role_id`),
KEY `user_id` (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- **
-- 后台主体栏目表 --
CREATE TABLE IF NOT EXISTS `cute_caid` (
`id` smallint(6) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(20) NOT NULL,
`title` varchar(50) DEFAULT NULL,
`status` tinyint(1) DEFAULT '0',
`remark` varchar(255) DEFAULT NULL,
`sort` smallint(6) unsigned DEFAULT NULL,
`href` varchar(150) not null,
`pid` smallint(6) unsigned NOT NULL,
`level` tinyint(1) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `level` (`level`),
KEY `pid` (`pid`),
KEY `status` (`status`),
KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
下载代码在下方

php-CMS安装代码逻辑-LMLPHPInstall.rar( 3.4 KB 下载:32 次 )

AD:真正免费,域名+虚机+企业邮箱=0元

09-17 09:07