資料庫設計
1,新建系統設定表
CREATE TABLE `sysconfig` (
`cid` int(11) NOT NULL auto_increment,
`vote_name` varchar(45 ) NOT NULL,
`dietime` date NOT NULL,
`method` int(11) NOT NULL default '1',
`description` varchar(800) NOT NULL default '',
PRIMARY KEY (`cid`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
#2, 新用戶表
#CREATE TABLE `users` (
`cid` int(11) NOT NULL auto_increment,
## `cid` int(11) NOT NULL auto_increment,
`username` varchar(40) NOT NULL,
# ` passwd` varchar(45) NOT NULL,
`admin` int(11) NOT NULL default '0',
`isvote` int(11) NOT NULL default '0',
PRIMARY KEY (`cid`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
3,新建投票題目表
CREATE TABLELE `votename` (
`cid` int(11) NOT NULL auto_increment,
## `cid` int(11) NOT NULL auto_increment,
`question_name` varchar(200) NOT NULL,
`votetype` int(11) NOT NULL default '0' COMMENT '0為單選\n1為多選',
`sumvotenum` int(11) NOT NULL default '1',
PRIMARY KEY (`cid `)
) ENGINE=MyISAM AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;
4,新投票選項表
#CREATE TABLE `voteoption` (
## `cid` int(11) NOT NULL auto_increment,
`optionname` varchar(100) NOT NULL default '',
# `votenum` int(11) NOT NULL default '0',
`upid` int(11) NOT NULL,
PRIMARY KEY (`cid`,`upid`),
# KEY `fk_voteoption_votename_idx` (`upid`)
) ENGINE=MyISAM AUTO_INCREMENT=50 DEFAULT CHARSET=utf8;
5,新增測試資料