我使用以下代码使用插件创建数据库表。但是,该表既没有创建,也没有收到任何错误消息。代码如下:
global $wpdb;
$table_name = "tbllb_club";
$sql = "create table $table_name (
club_id int(11) NOT NULL auto_increment,
project_name varchar(500) NOT NULL,
first_name varchar(100) NOT NULL,
school_status varchar(50) NOT NULL,
school_name varchar(200) NOT NULL,
school_city varchar(50) NOT NULL,
school_state varchar(50) NOT NULL,
year_in_school varchar(50) NOT NULL,
age int(2) NOT NULL,
email varchar(200) NOT NULL,
mobile varchar(15) NOT NULL,
chat_id varchar(50) NOT NULL,
facebook_page_link varchar(200) NOT NULL,
mailing_address_street varchar(50) NOT NULL,
mailing_address_city varchar(50) NOT NULL,
mailing_address_state varchar(50) NOT NULL,
mailing_address_zip char(6) NOT NULL,
social_networking varchar(50) NOT NULL,
organization_involvement varchar(2000) NOT NULL,
yesclub_heard varchar(50) NOT NULL,
volunteer_experience varchar(2000) NOT NULL,
volunteer_reason varchar(2000) NOT NULL,
skills varchar(2000) NOT NULL,
creative_ideas varchar(5000) NOT NULL,
other_information varchar(2000) NOT NULL,
face_photo_url varchar(200),
school_image_url varchar(200),
video_clip_url varchar(200),
PRIMARY KEY (club_id)
);";
require_once(ABSPATH . \'wp-admin/includes/upgrade.php\');
dbDelta($sql);
我遵守了Wordpress Codex中提到的规则。请帮忙!!提前谢谢。