Zen Cart Logo
Forums / General Questions / 1064 SQL error on Featured Products page

1064 SQL error on Featured Products page

Views: 1,059

Results 1 to 5 of 5
7 Sep 2011, 4:20 PM
#1
rconway28 avatar

rconway28

New Zenner

Join Date:
Feb 2011
Posts:
9
Plugin Contributions:
0

1064 SQL error on Featured Products page

Everything in my store (not active yet) is working fine. Some time ago when I added the Product Columns add-on a noticed an error I was getting when I clicked "more" in the Featured Product Sidebox.

The error is as follows:

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 'limit 3' at line 1
in:
[ limit 3]

The limit number changes based on my settings in the admin under max values. I messed with that because some similar threads suggested it might be a limit="0" issue. I still get the error after changing the value to any number.

Most 1064 SQL errors give you the place where the error is occuring after the "at line 1 in:" but my error is blank after that so I have no idea what file it is happening in.

I have temp dealt with this by removing any reference links to the main Featured Product Index page, but that is not a great solution.

Any help would be greatly appreciated as I fear I am corrupting my SQL databse by letting the error continue.

You can see the error here: http://www.creativechocolatedesign.com/index.php?main_page=featured_products

I am running v1.3.9h

Thanks ahead of time.

7 Sep 2011, 7:38 PM
#2
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,288
Plugin Contributions:
39

Re: 1064 SQL error on Featured Products page

Have you ran check and repair on the database?

~Melanie

8 Sep 2011, 2:15 AM
#3
rconway28 avatar

rconway28

New Zenner

Join Date:
Feb 2011
Posts:
9
Plugin Contributions:
0

Re: 1064 SQL error on Featured Products page

Thanks for that.

I am not well versed in database admin. Ran it and found the following:

Problems with indexes of table zen_so_payment_types
The following indexes appear to be equal and one of them should be removed: type_code, type_code_2

Problems with indexes of table zen_so_refunds
The following indexes appear to be equal and one of them should be removed: PRIMARY, refund_id

From a layman's perspective I think those are small errors that were created when I added the Super Orders Module. Could that cause the Featured Products page to get an error? I am afraid to remove either index as I am not sure which is the correct one.

8 Sep 2011, 2:30 AM
#4
drbyte avatar

drbyte

Sensei

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

Re: 1064 SQL error on Featured Products page

rconway28:

Thanks for that.

I am not well versed in database admin. Ran it and found the following:

Problems with indexes of table zen_so_payment_types
The following indexes appear to be equal and one of them should be removed: type_code, type_code_2

Problems with indexes of table zen_so_refunds
The following indexes appear to be equal and one of them should be removed: PRIMARY, refund_id

From a layman's perspective I think those are small errors that were created when I added the Super Orders Module. Could that cause the Featured Products page to get an error? I am afraid to remove either index as I am not sure which is the correct one.
Those are trivial, and are extremely minor issues related only to performance/speed tuning. And, given that your use of those tables is highly unlikely to climb into the hundreds of thousands of records, you can safely ignore those suggestions, as they will not impede performance of your site to any noticeable degree.
They're completely unrelated to the symptoms you reported in your first post.

As for dealing with the issue in your first post, on the surface it appears as though you've got a script on your site that's generating invalid SQL statements to send to the database. You'll need to find the offending piece of code and fix it.
I can't give you a magical answer to fix it. You'll need to find out what's altered from original core code and study whether it's been altered in a way that is actually correct, or whether it needs fixing or whether addon code needs to be re-installed correctly or needs to be deleted because the addon code is bad.

http://www.zen-cart.com/wiki/index.php/Troubleshoot_-_Diagnosing_Obscure_Issues

8 Sep 2011, 2:38 AM
#5
rconway28 avatar

rconway28

New Zenner

Join Date:
Feb 2011
Posts:
9
Plugin Contributions:
0

Re: 1064 SQL error on Featured Products page

Thanks Dr Byte.

Sadly it is what I assumed. This is my first Zen Cart site and in hind site I would have kept much better track of all of the add-ons that I have loaded. Tie that in to all the custom code I have added and/or tweaked for design features and I am not sure I could ever find it.

Although I am pretty sure it happened after I added the Column for New Products and Features Products Add ON. Maybe I will investigate a little.

For now I am fine hiding the Featured Products index page since everything else is running smoothly. In your expertise opinion, is that errant code causing any permanent issues that will eventually bite me in the ########?

Thank you and the others for your input. This was the only issue (of many along the way) that I could not find an answer to just by searching the forum and the only one I posted about. Well, I posted something Sunday about the UPS server outage (hacking related), but even that wasn't a ZC issue and someone still enlightened me to what it was!!

Great community.