#檢查資料表(show_prod) if(!chk_isTable("show_prod")) go_update3();
######################################## # 建立資料表show_prod ######################################## function go_update3() { global $mysqli; $sql=" CREATE TABLE `show_prod` ( `sn` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'prod_sn', `kind` smallint(5) unsigned NOT NULL default 0 COMMENT '分類', `title` varchar(255) NOT NULL default '' COMMENT '名稱', `summary` text NOT NULL default '' COMMENT '摘要', `content` text NOT NULL default '' COMMENT '內容', `price` int(10) unsigned NOT NULL default 0 COMMENT '價格', `enable` enum('1','0') NOT NULL DEFAULT '1' COMMENT '狀態', `date` int(10) unsigned NOT NULL default 0 COMMENT '建立日期', `sort` smallint(5) unsigned NOT NULL default 0 COMMENT '排序', `counter` int(10) unsigned NOT NULL default 0 COMMENT '人氣', PRIMARY KEY (`sn`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; ";//die($sql); $mysqli->query($sql) or die(printf("Error: %s <br>".$sql, $mysqli->sqlstate)); return true; }
mk_dir(WEB_PATH."/uploads/prod");//商品圖