<?php
define('RUN_IN','FRONT_END');
ob_start();
if(file_exists('config/config.php')){
require('config/config.php');
ob_end_clean();
define('CORE_INCLUDE_DIR',CORE_DIR.
((!defined('SHOP_DEVELOPER') || !constant('SHOP_DEVELOPER')) && version_compare(PHP_VERSION,'5.0','>=')?'/include_v5':'/include'));
require(CORE_INCLUDE_DIR.'/shopCore.php');
class installCore extends shopCore{
function run(){}
}
$core = new installCore();
$sql[] = <<<EOT
CREATE TABLE `sdb_diyconfig` (
`config_id` int(11) NOT NULL auto_increment,
`config_name` varchar(200) NOT NULL,
`diycat_id` int(11) NOT NULL default '0',
`config_desc` varchar(2000) default NULL,
`member_id` int(11) NOT NULL,
`config_data` text NOT NULL,
`date_create` datetime NOT NULL,
`date_update` datetime NOT NULL,
`is_recommend` tinyint(1) NOT NULL default '0',
`sortnum` int(11) NOT NULL default '0',
`disabled` enum('true','false') NOT NULL default 'false',
PRIMARY KEY (`config_id`)
) DEFAULT CHARSET=utf8 ;
EOT;
$sql[] = <<<EOT
CREATE TABLE `sdb_diycat` (
`diycat_id` int(11) NOT NULL auto_increment,
`diycat_name` varchar(50) NOT NULL,
`sortnum` int(11) NOT NULL default '0',
`disabled` enum('true','false') NOT NULL default 'false',
PRIMARY KEY (`diycat_id`)
) DEFAULT CHARSET=utf8;
EOT;
$db = $core->database();
foreach ($sql as $s){
$ret = $db->exec($s);
echo "<BR>".$s."<BR>".($ret ? 'success' : 'fail');
}
}
?>
回复 更多评论