Hi ESMI
would be glad if you can help me out,
<?php
// Plugin Name: test test test
?>
<?php
function create_table()
{
global $wpdb;
$table_name = $wpdb->prefix."test";
if($wpdb->get_var("show tables like '$table_name'") != $table_name){
$myquery = "CREATE TABLE ".$table_name." (
ID mediumint(10) NOT NULL AUTO_INCREMENT,
name VARCHAR(20) NOT NULL,
UNIQUE KEY ID (ID)
);";
require_once(ABSPATH. '/wp-admin/includes/upgrade.php');
dbDelta($myquery);
}
}
register_activation_hook( _FILE_,'create_table');
?>
I can activate this plugin, but it does not create a table at all,
When activate this plugin "register_activation_hook( _FILE_,'create_table');" should call create_table, isn't it?