سلام دوستان
اين كد رو نوشتم ، مشكلش چيه كه جدوال هارو درست نمي كنه؟
كد sqlش رو تست كردم درسته
<?php
function createTables(){
global $wpdb;
$sql = "create table wp_mainMenu(
mainMenuId int not null auto_increment primary key,
title varchar(50),
showAccordion bit,
defaultOpen bit,
priority int
);# MySQL returned an empty result set (i.e. zero rows).
create table wp_subMenu(
subMenuId int not null auto_increment primary key,
mainMenuId int,
title varchar(50),
priority int,
foreign key(mainMenuId) references mainMenu(mainMenuId) on delete cascade on update cascade
);
";
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
dbDelta( $sql );
}
register_activation_hook(__FILE__, 'createTables');