我不知道错在哪里。我的代码没有在WAMP中创建表:
function subscribe_table() {
global $wpdb;
$table_name = $wpdb->prefix.\'_databasesubs\';
$charset_collate = $wpdb->get_charset_collate();
if ( $wpdb->get_var( \'SHOW TABLES LIKE \'. $table_name ) != $table_name ) {
$sql = "CREATE TABLE $table_name (
sno int(2) NOT NULL AUTO_INCREMENT, email varchar(25), name varchar(25), contact int(10)
) $charset_collate;";
}
require_once( ABSPATH . \'wp-admin/includes/upgrade.php\' );
dbDelta( $sql );
}
register_activation_hook( __FILE__, \'subscribe_table\' );