網站程式設計-PHP
  
  
    
	
	- 商品展示資料表
	
 
	- 增加商品資料表,從 update.php 著手
	
		- op_list() 加入
		
  #檢查資料表(show_prod)
  if(!chk_isTable("show_prod")) go_update3();
		
 
		 
		- 增加 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;
}
		
 
		- 圖片儲存位置
		uploads/prod
		op_list() 增加
		
  mk_dir(WEB_PATH."/uploads/prod");//商品圖