<?php 

if(!mysql_is_table('mastertable')){
$ctreate_table_sql="CREATE TABLE `mastertable`(
`id` INT( 10 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`name` VARCHAR( 50 ) NOT NULL ,
`displayorder` INT( 5 ) NOT NULL ,
`field_type` INT( 2 ) NOT NULL ,
`table_name` VARCHAR( 50 ) NOT NULL 
) TYPE = MYISAM ";
mysql_query($ctreate_table_sql);
}
if(!mysql_is_table('single_field_table')){
$ctreate_table_sql="CREATE TABLE `single_field_table` (
`id` INT( 10 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`mastertableid` INT( 2 ) NOT NULL ,
`name` VARCHAR( 50 ) NOT NULL ,
`display_order` INT( 10 ) NOT NULL 
) TYPE = MYISAM ";

mysql_query($ctreate_table_sql);
}
if(!mysql_is_table('double_field_table')){
$ctreate_table_sql="CREATE TABLE `double_field_table` (
`single_field_id` INT NOT NULL ,
`second_fieldid` INT NOT NULL 
) TYPE = MYISAM ";
mysql_query($ctreate_table_sql);
}



?>
