1,根据需求,我们分析应有三张表
--选项表 item
create table item(
id bigint unsigned primary key auto_increment,
name varchar(64) not null,
description varchar(128) not null,
vote_count bigint unsigned
)engine MyISAM;
--投票的日志表 vote_log
create table vote_log(
id bigint unsigned primary key auto_increment,
ip varchar(20) not null,
vote_date bigint not null,
item_id bigint not null)engine MyISAM;
--过滤ip的表 filter
create table filter(
id bigint unsigned primary key auto_increment,
ip varchar(20)
)engine MyISAM;
3,在zendstudio中创建空项目,然后把相关的文件拷贝
4,创建AdminController 控制器(管理后台的各种请求)
5,创建HomeController 控制器(普通用户去投票)
......