php - SQL Syntax Error for 5.5.35-MariaDB -
i getting following error message when trying run sql code in 5.5.35-mariadb. please can me understand wrong?
you have error in sql syntax; check manual corresponds mariadb server version right syntax use near 'create table if not exists
action_recorder
(id
int(11) not null auto_i' @ line 1
my code below:
create table if not exists `action_recorder` ( `id` int(11) not null auto_increment, `module` varchar(255) collate utf8_unicode_ci not null, `user_id` int(11) default null, `user_name` varchar(255) collate utf8_unicode_ci default null, `identifier` varchar(255) collate utf8_unicode_ci not null, `success` char(1) collate utf8_unicode_ci default null, `date_added` datetime not null, primary key (`id`), key `idx_action_recorder_module` (`module`), key `idx_action_recorder_user_id` (`user_id`), key `idx_action_recorder_identifier` (`identifier`), key `idx_action_recorder_date_added` (`date_added`) ) engine=innodb default charset=utf8 collate=utf8_unicode_ci auto_increment=23 ;
please can me resolve this? thanks!
you're missing closing parenthesis. 1 @ end key idx_action_recorder_date_added
, need 1 close whole table definition.
also, think shouldn't use normal single quotes. strings. use backticks or omit them altogether.
Comments
Post a Comment