Unexpected Token issues when trying to run SQL query for zencart

624 Views Asked by At

I am fairly new to this and I am attempting to run the following queries in the add-on - Add Pages to More Information Sidebox

Does anyone see what I cannot? PHPmyadmin shows many Unexpected token issues in each of the following three queries!

Unexpected Tokens

Query #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\'),');

Query #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\'),');

Query #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\'),');

There has to be something that I cannot see but again I am new to this! Thank you in advance for any assistance and/or guidance!

2

There are 2 best solutions below

0
D-Shih On

The issue is on INSERT Statement last insert data zen_cfg_select_option.

You should 'zen_cfg_select_option(array(\'0\', \'1\', \'2\', \'3\'),') insetead of 'zen_cfg_select_option(array(\'0\', \'1\', \'2\', \'3\'))'

BTW,You might set typesetting on your sql statement next time,maybe you will figure out the issue.

Query 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\')'
);

Query 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\')'
);

Query 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\'))'
);
0
Scott C Wilson On

This file works fine when you import it using Admin->Tools->Install SQL Patches in your Zen Cart admin. People get in trouble running these scripts under phpMyAdmin because their tables have prefixes (like "zen_") which the admin import handles correctly but phpMyAdmin does not. (With phpMyAdmin, if your tables have a prefix, you'd have to modify the script to reflect that.)