Forums / All Other Contributions/Addons / Cross Sell My Sql Syntax Error

Cross Sell My Sql Syntax Error

Locked

Views: 6,140

Results 1 to 17 of 17
This thread is locked. New replies are disabled.
12 Nov 2006, 7:50 PM
#1
squid avatar

squid

New Zenner

Join Date:
Mar 2006
Posts:
12
Plugin Contributions:
0

Cross Sell My Sql Syntax Error

Zencart v. 1.3.5
Database: MySQL 4.0.27-standard-log
PHP Version: 4.4.4
Mods:
column layout Grid 1.3.5
Back up MYSQL Admin
1.3.5 xss patch2

I have tried to install cross sell and also cross sell advanced. When I try to upload products xsell_sql into Admin I get this error:

1064 You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'true','false'), ', now())' at line 1
in:
[INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Cross-Sell - Display prices?', 'XSELL_DISPLAY_PRICE', 'false', 'Cross-Sell -- Do you want to display the product prices too?
Default: false', 18, 72, 'zen_cfg_select_option(array('true','false'), ', now());]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

I have checked the forum and I didn't find a solution to this problem.

'zen_cfg_select_option(array('true','false'), ', now());
I wonder if the escapes in the 'true' 'false' above are the problem, but I know the xsell mod has worked successfully for many others.

Thanks for any help.

13 Nov 2006, 5:51 AM
#2
antiocles avatar

antiocles

New Zenner

Join Date:
Oct 2006
Posts:
12
Plugin Contributions:
0

Re: Cross Sell My Sql Syntax Error

Same thing happens to me.

Anticoles

14 Nov 2006, 5:28 PM
#3
thebeveragegourmet avatar

thebeveragegourmet

Zen Follower

Join Date:
Nov 2006
Posts:
163
Plugin Contributions:
0

Re: Cross Sell My Sql Syntax Error

I get the same error too


14 Nov 2006, 6:11 PM
#4
iwebgeek avatar

iwebgeek

New Zenner

Join Date:
May 2006
Posts:
43
Plugin Contributions:
0

Re: Cross Sell My Sql Syntax Error

Still looking for a fix to this problem

14 Nov 2006, 6:15 PM
#5
thebeveragegourmet avatar

thebeveragegourmet

Zen Follower

Join Date:
Nov 2006
Posts:
163
Plugin Contributions:
0

Re: Cross Sell My Sql Syntax Error

thanks for the post. At least it's being worked on. Appreciate the update


25 Nov 2006, 1:21 AM
#6
hmreseller avatar

hmreseller

New Zenner

Join Date:
Jan 2006
Posts:
11
Plugin Contributions:
0

Re: Cross Sell My Sql Syntax Error

Anybody gotten an answer yet? I'm getting the same error.

26 Nov 2006, 9:16 PM
#7
hmreseller avatar

hmreseller

New Zenner

Join Date:
Jan 2006
Posts:
11
Plugin Contributions:
0

Re: Cross Sell My Sql Syntax Error

I think I've got this figured out!

I downloaded v1.3.0 (because previous posts mentioned having it work) and tried that. I still got the MySQL error, so I played around with the .sql file and finally gotit to work by adding DOUBLE QUOTES here:

"zen_cfg_select_option(array('true','false'),"

This may also work in the 1.3.1 version, but I found the install instructions so much easier than v1.3.1 to follow, especially for a New Zenner like myself.

Have tested in my cart and all seems to work properly. Gosh it's so nice to be able to contribute once in a while!

2 Dec 2006, 7:51 PM
#8
squid avatar

squid

New Zenner

Join Date:
Mar 2006
Posts:
12
Plugin Contributions:
0

Re: Cross Sell My Sql Syntax Error

Just an update: This issue was solved by copying and pasting one section of the .sql doc at a time. Then it didn’t throw errors. No changes were necessary to the actual .sql document.

Hope this works for someone else.

3 Dec 2006, 3:29 PM
#9
thebeveragegourmet avatar

thebeveragegourmet

Zen Follower

Join Date:
Nov 2006
Posts:
163
Plugin Contributions:
0

Re: Cross Sell My Sql Syntax Error

okay, stupid question here but what do you mean copying and pasting one section of the sql at a time? Do you mean keepting seciton one in, saving it, uploading it and then just uploading section 2....?


3 Dec 2006, 3:37 PM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Cross Sell My Sql Syntax Error

You could save the trouble of guessing by just using phpMyAdmin instead of the SQL Patch screen.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

4 Dec 2006, 2:00 AM
#11
veamon avatar

veamon

New Zenner

Join Date:
Dec 2006
Posts:
2
Plugin Contributions:
0

Re: Cross Sell My Sql Syntax Error

I had this problem, and the easiest solution was to just cut and paste a section at a time.

For example, the sql file in it's entirety looks like this:

## Cross Sell v1.3.0
#
## The following is used to install the Cross-Sell Products mapping table and the admin switches for display control in the catalog.
## This script should be able to be run from Admin->Tools->Install SQL Patches
#

#DROP TABLE IF EXISTS products_xsell;
CREATE TABLE products_xsell (
  ID int(10) NOT NULL auto_increment,
  products_id int(10) unsigned NOT NULL default 1,
  xsell_id int(10) unsigned NOT NULL default 1,
  sort_order int(10) unsigned NOT NULL default 1,
  PRIMARY KEY  (ID), 
  KEY idx_products_id_xsell (products_id)
) TYPE=MyISAM;


## add switches for:  MIN_DISPLAY_XSELL, MAX_DISPLAY_XSELL
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Display Cross-Sell Products', 'MIN_DISPLAY_XSELL', 1, 'This is the minimum number of configured Cross-Sell products required in order to cause the Cross Sell information to be displayed.<br />Default: 1', 2, 17, now());
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Display Cross-Sell Products', 'MAX_DISPLAY_XSELL', 6, 'This is the maximum number of configured Cross-Sell products to be displayed.<br />Default: 6', 3, 66, now());
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Cross-Sell Products Columns per Row', 'SHOW_PRODUCT_INFO_COLUMNS_XSELL_PRODUCTS', '3', 'Cross-Sell Products Columns to display per Row<br />0= off or set the sort order.<br />Default: 3', 18, 72, 'zen_cfg_select_option(array(0, 1, 2, 3, 4), ', now());
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Cross-Sell - Display prices?', 'XSELL_DISPLAY_PRICE', 'false', 'Cross-Sell -- Do you want to display the product prices too?<br />Default: false', 18, 72, 'zen_cfg_select_option(array(\'true\',\'false\'), ', now());


## For upgraders, you may want to add the additional index for marginal speed improvements:
# ALTER TABLE products_xsell ADD INDEX idx_products_id_xsell (products_id);
# INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Cross-Sell - Display prices?', 'XSELL_DISPLAY_PRICE', 'false', 'Cross-Sell -- Do you want to display the product prices too?<br />Default: false', 18, 72, 'zen_cfg_select_option(array(\'true\',\'false\'), ', now());
```Cutting and pasting it basically just boils down to doing a group at a time.  For it to work on mine, I did this section first:

CREATE TABLE products_xsell (
ID int(10) NOT NULL auto_increment,
products_id int(10) unsigned NOT NULL default 1,
xsell_id int(10) unsigned NOT NULL default 1,
sort_order int(10) unsigned NOT NULL default 1,
PRIMARY KEY (ID),
KEY idx_products_id_xsell (products_id)
) TYPE=MyISAM;

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Display Cross-Sell Products', 'MIN_DISPLAY_XSELL', 1, 'This is the minimum number of configured Cross-Sell products required in order to cause the Cross Sell information to be displayed.<br />Default: 1', 2, 17, now());
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Display Cross-Sell Products', 'MAX_DISPLAY_XSELL', 6, 'This is the maximum number of configured Cross-Sell products to be displayed.<br />Default: 6', 3, 66, now());
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Cross-Sell Products Columns per Row', 'SHOW_PRODUCT_INFO_COLUMNS_XSELL_PRODUCTS', '3', 'Cross-Sell Products Columns to display per Row<br />0= off or set the sort order.<br />Default: 3', 18, 72, 'zen_cfg_select_option(array(0, 1, 2, 3, 4), ', now());
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Cross-Sell - Display prices?', 'XSELL_DISPLAY_PRICE', 'false', 'Cross-Sell -- Do you want to display the product prices too?<br />Default: false', 18, 72, 'zen_cfg_select_option(array('true','false'), ', now());

11 Dec 2006, 10:30 PM
#12
blackinches avatar

blackinches

New Zenner

Join Date:
Nov 2006
Posts:
43
Plugin Contributions:
0

Re: Cross Sell My Sql Syntax Error

yeah i'm having the same syntax problem. i tried uploading the file and copying and pasting it in and still won't work. any other suggestions?

14 Dec 2006, 11:22 AM
#13
danallkins avatar

danallkins

Zen Follower

Join Date:
Aug 2006
Posts:
135
Plugin Contributions:
0

Re: Cross Sell My Sql Syntax Error

I have the say error... why would I be getting this now??? I haven't made any changes.

14 Dec 2006, 11:26 AM
#14
danallkins avatar

danallkins

Zen Follower

Join Date:
Aug 2006
Posts:
135
Plugin Contributions:
0

Re: Cross Sell My Sql Syntax Error

DrByte:

You could save the trouble of guessing by just using phpMyAdmin instead of the SQL Patch screen.

What do I need to do to fix it DrByte?

Thanks
Dan

6 Sep 2007, 7:51 PM
#15
garenthino avatar

garenthino

New Zenner

Join Date:
Aug 2007
Location:
Oklahoma City, OK, USA
Posts:
12
Plugin Contributions:
0

Re: Cross Sell My Sql Syntax Error

My syntax error is a little different; After installing the latest mod version (1.3.1), copying the required files, modifying the two required files, importing code into the database via Zen Admin (no errors), I get this error message on the product info page:

Parse error: syntax error, unexpected T_REQUIRE in /home/thephoen/public_html/HouseStore/includes/templates/gloss_black/templates/tpl_product_info_display.php on line 1

Now, while I realize that this is usually indicitive of a missing semicolon, I cannot find a single line of code requiring one that doesn't already have one. What's more, when restoring the original two files which I backed up beforehand I get a different syntax error.

Examining the database code, it would seem that restoring the originals would make the admin script simply not seem to function, as the cross-sell module and associated files would not ever be called from product_info.php or tpl_product_info_display.php. Why the new syntax error? I cannot figure out how to make this module work...

Remember, boys and girls, alcohol and calculus don't mix; never drink and derive!

6 Sep 2007, 8:12 PM
#16
garenthino avatar

garenthino

New Zenner

Join Date:
Aug 2007
Location:
Oklahoma City, OK, USA
Posts:
12
Plugin Contributions:
0

Re: Cross Sell My Sql Syntax Error

My site is:

http://shop.thephoenixhouse.net

Warning: Adult Content!

If anyone has a suggestion, it would be greatly appreciated. If this code hase been revised for 1.3.7, please point me to the revision? I tried to find a similar issue on the forums, but no luck.

Remember, boys and girls, alcohol and calculus don't mix; never drink and derive!

22 Sep 2007, 10:04 PM
#17
big_woody avatar

big_woody

New Zenner

Join Date:
Sep 2007
Posts:
35
Plugin Contributions:
0

Re: Cross Sell My Sql Syntax Error

can some one please advise me on what to do ..
have installed Cross-Sell then Advanced Cross Sell..
Cross Sell seems to be working and so does Advanced Cross Sell to a degree but when i try and "CLEAN CROSS SELL" i get this error ..


1064 You have an error in your SQL syntax near 'SELECT products_id FROM products WHERE 1=1)' at line 1
in:
[DELETE FROM products_xsell WHERE products_id NOT IN (SELECT products_id FROM products WHERE 1=1)]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.


Also i can not use the "ADD PRODUCT FIELD BUTTON" nothing seems to happen, nor does the "CROSS SELL ONWAY" tick box.

I have tried updateing my SQL database with the sql_patch through myPHPadmin but get this error ..


SQL-query :

INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function )
VALUES (
'', 'Input type to be used in form', 'XSELL_FORM_INPUT_TYPE', 'model', 'Choose to use product ID or MODEL as your input type. Check readme file for more info', @t4, 1, NOW( ) , NOW( ) , NULL , 'zen_cfg_select_option(array(''id'', ''model''),'
)

MySQL said:

Duplicate entry 'XSELL_FORM_INPUT_TYPE' for key 2


I have also tried it through "INSTALL SQL PATCH" both as small file sand one large one as suggested but still no go ..

This is the sql_patch


SET @t4=0;
SELECT (@t4:=configuration_group_id) as t4
FROM configuration_group
WHERE configuration_group_title= 'Cross Sell';
DELETE FROM configuration WHERE configuration_group_id = @t4;
DELETE FROM configuration_group WHERE configuration_group_id = @t4;

INSERT INTO configuration_group VALUES ('', 'Cross Sell', 'Set Cross Sell Options', '1', '1');
UPDATE configuration_group SET sort_order = last_insert_id() WHERE configuration_group_id = last_insert_id();

SET @t4=0;
SELECT (@t4:=configuration_group_id) as t4
FROM configuration_group
WHERE configuration_group_title= 'Cross Sell';

UPDATE configuration SET configuration_group_id = @t4 WHERE configuration_key IN ('MIN_DISPLAY_XSELL','MAX_DISPLAY_XSELL','SHOW_PRODUCT_INFO_COLUMNS_XSELL_PRODUCTS','XSELL_DISPLAY_PRICE');

INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES
('', 'Input type to be used in form', 'XSELL_FORM_INPUT_TYPE', 'model', 'Choose to use product ID or MODEL as your input type. Check readme file for more info', @t4, 1, NOW(), NOW(), NULL, 'zen_cfg_select_option(array(''id'', ''model''),');


I am running the latest Zen-Cart (Zen Cart 1.3.7.1) with database patch ( Database Patch Level: 1.3.7.1)

Please help me out guys.