尝试为zencart运行SQL查询时出现意外的令牌问题

时间:2018-02-13 01:50:44

标签: mysql sql phpmyadmin zen-cart

我对此很新,我正在尝试在插件中运行以下查询 - Add Pages to More Information Sidebox

有人看到我不能做的事吗? PHPmyadmin在以下三个查询中显示了许多意外的令牌问题!

Unexpected Tokens

查询#1:

insert into configuration (configuration_title, configuration_key, configuration_value, 
configuration_description, configuration_group_id, sort_order, last_modified, date_added, 
use_function, set_function) values ('Define Page 5', 'DEFINE_PAGE_5_STATUS', '1', 'Enable 
the Defined Page 5 Link/Text?<br />0= Link ON, Define Text OFF<br />1= Link ON, Define 
Text ON<br />2= Link OFF, Define Text ON<br />3= Link OFF, Define Text OFF', '25', '85', 
now(), now(), NULL, 'zen_cfg_select_option(array(\'0\', \'1\', \'2\', \'3\'),');

查询#2:

insert into configuration (configuration_title, configuration_key, configuration_value, 
configuration_description, configuration_group_id, sort_order, last_modified, date_added, 
use_function, set_function) values ('Define Page 6', 'DEFINE_PAGE_6_STATUS', '1', 'Enable 
the Defined Page 6 Link/Text?<br />0= Link ON, Define Text OFF<br />1= Link ON, Define 
Text ON<br />2= Link OFF, Define Text ON<br />3= Link OFF, Define Text OFF', '25', '85', 
now(), now(), NULL, 'zen_cfg_select_option(array(\'0\', \'1\', \'2\', \'3\'),');

查询#3:

insert into configuration (configuration_title, configuration_key, configuration_value, 
    configuration_description, configuration_group_id, sort_order, last_modified, date_added, 
    use_function, set_function) values ('Define Page 7', 'DEFINE_PAGE_7_STATUS', '1', 'Enable 
    the Defined Page 7 Link/Text?<br />0= Link ON, Define Text OFF<br />1= Link ON, Define 
    Text ON<br />2= Link OFF, Define Text ON<br />3= Link OFF, Define Text OFF', '25', '85', 
    now(), now(), NULL, 'zen_cfg_select_option(array(\'0\', \'1\', \'2\', \'3\'),');

必须有一些我看不到的东西,但我又是新手! 提前感谢您的任何帮助和/或指导!

2 个答案:

答案 0 :(得分:0)

问题出在INSERT声明上次插入数据zen_cfg_select_option

你应该'zen_cfg_select_option(array(\'0\', \'1\', \'2\', \'3\'),')  不确定'zen_cfg_select_option(array(\'0\', \'1\', \'2\', \'3\'))'

BTW,你可以在下次的sql语句中设置排版,也许你会发现问题。

查询1

insert into configuration 
(
    configuration_title, 
    configuration_key, 
    configuration_value, 
    configuration_description, 
    configuration_group_id, 
    sort_order, 
    last_modified, 
    date_added, 
    use_function, 
    set_function
) 
values 
(
    'Define Page 5', 
    'DEFINE_PAGE_5_STATUS', 
    '1', 
    'Enable the Defined Page 5 Link/Text?<br />0= Link ON, Define Text OFF<br />1= Link ON, Define Text ON<br />2= Link OFF, Define Text ON<br />3= Link OFF, Define Text OFF',
    '25',
    '85', 
    now(), 
    now(), 
    NULL, 
    'zen_cfg_select_option(array(\'0\', \'1\', \'2\', \'3\')'
);

查询2

INSERT INTO configuration 
(
    configuration_title, 
    configuration_key, 
    configuration_value, 
    configuration_description, 
    configuration_group_id, 
    sort_order, 
    last_modified, 
    date_added, 
    use_function, 
    set_function
) 
VALUES 
(
    'Define Page 6', 
    'DEFINE_PAGE_6_STATUS', 
    '1', 
    'Enable the Defined Page 6 Link/Text?<br />0= Link ON, Define Text OFF<br />1= Link ON, Define Text ON<br />2= Link OFF, Define Text ON<br />3= Link OFF, Define Text OFF',
    '25', 
    '85', 
    now(), 
    now(), 
    NULL, 
    'zen_cfg_select_option(array(\'0\', \'1\', \'2\', \'3\')'
);

查询3

INSERT INTO configuration 
(
    configuration_title, 
    configuration_key, 
    configuration_value, 
    configuration_description, 
    configuration_group_id, 
    sort_order, 
    last_modified, 
    date_added, 
    use_function, 
    set_function
) 
VALUES 
(
    'Define Page 7', 
    'DEFINE_PAGE_7_STATUS', 
    '1', 
    'Enable the Defined Page 7 Link/Text?<br />0= Link ON, Define Text OFF<br />1= Link ON, Define Text ON<br />2= Link OFF, Define Text ON<br />3= Link OFF, Define Text OFF', 
    '25', 
    '85', 
    now(), 
    now(),
    NULL, 
    'zen_cfg_select_option(array(\'0\', \'1\', \'2\', \'3\'))'
);

答案 1 :(得分:0)

使用Admin-&gt; Tools-&gt;在Zen Cart管理员中安装SQL修补程序导入此文件时,此文件正常工作。人们在phpMyAdmin下运行这些脚本时遇到了麻烦,因为他们的表有前缀(例如&#34; zen _&#34;),管理员导入正确处理,但phpMyAdmin没有。 (使用phpMyAdmin,如果你的表有前缀,你必须修改脚本以反映它。)