php - 1064 SQL create table error -
1064:you have error in sql syntax; check manual corresponds mysql server version right syntax use near ''models'( 'model_id' int not null auto_increment primary key, 'model_usernam' @ line 1
i have error when try create sql table.
and code.. please help..
$sql = "create table if not exists 'models'( 'model_id' int not null auto_increment primary key, 'model_username' varchar(250) not null, 'model_gender' enum('f','m','s','c') not null, 'model_show' enum('public','private','group','away') not null, 'model_age' int not null, 'model_time' int not null, 'model_new' tinyint(1) not null default '0', 'model_hd' tinyint(1) not null default '0', 'model_recorded' tinyint(1) not null default '0', 'model_image' varchar(250) not null, 'model_users' int not null, 'model_language' varchar(250), 'model_name' varchar(250), 'model_location' varchar(250), 'model_subject' varchar(250), 'model_roomurl' varchar(250) not null, 'model_roomurlrevshre' varchar(250) not null, 'model_iframe' varchar(250) not null, 'model_iframerevshre' varchar(250) not null, 'model_birthday' varchar(250) not null )";
use backticks column names instead of single-quotes.
$sql = "create table if not exists `models`( `model_id` int not null auto_increment primary key, `model_username` varchar(250) not null, `model_gender` enum('f','m','s','c') not null, `model_show` enum('public','private','group','away') not null, `model_age` int not null, ...
Comments
Post a Comment