Zen Cart Logo
Forums / General Questions / How do I fix SQL syntax error 1064 New Products, Featured, et al...

How do I fix SQL syntax error 1064 New Products, Featured, et al...

Views: 1,935

Results 1 to 7 of 7
30 Sep 2011, 1:52 PM
#1
dwkettle avatar

dwkettle

New Zenner

Join Date:
Apr 2011
Location:
Saginaw, MI
Posts:
13
Plugin Contributions:
0

How do I fix SQL syntax error 1064 New Products, Featured, et al...

I am relatively new to ZenCart (v. 1.3.9b), but that hasn't stopped me from customizing and making changes to code here and there. However, I wanted to fix the fact that disabled products were showing up in the New Products boxes, and I did something horribly wrong.

Instead of New Products, Featured products, etc.. I get this error message:

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 ')' at line 7
in:
[select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name, p.products_date_added, p.products_price, p.products_type, p.master_categories_id from zen_products p, zen_products_description pd where p.products_id = pd.products_id and pd.language_id = '1' and p.products_status = 1 and p.products_id in ()]

See it here: http://spartanpools.com/

:oops:

I've tried replacing both New_Products.php and Featured_Products.php with original files, but I may have done something elsewhere in a fugue state of coding. Shame on me. Please help!

30 Sep 2011, 2:28 PM
#2
dwkettle avatar

dwkettle

New Zenner

Join Date:
Apr 2011
Location:
Saginaw, MI
Posts:
13
Plugin Contributions:
0

Re: How do I fix SQL syntax error 1064 New Products, Featured, et al...

I can't stand having that error message on my main page! I disabled the New and featured Products in Config > Index Listing. You can still see the error message here: http://spartanpools.com/main-access-m-31.html all the way at the bottom of the page.

Also, for whatever reason, the sideboxes don't show up on pages displaying the error.

30 Sep 2011, 2:34 PM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: How do I fix SQL syntax error 1064 New Products, Featured, et al...

What happens if you turn off the SEO/rewrites ... does it change anything? :unsure:

30 Sep 2011, 2:58 PM
#4
dwkettle avatar

dwkettle

New Zenner

Join Date:
Apr 2011
Location:
Saginaw, MI
Posts:
13
Plugin Contributions:
0

Re: How do I fix SQL syntax error 1064 New Products, Featured, et al...

I changed SEO URLs to false and still no dice.
However, I only get the error when "Show New Products on Main Page" is enabled.
Interesting, but i always get the error on the Manufacturer's page and on Cart is Empty page.

30 Sep 2011, 3:50 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: How do I fix SQL syntax error 1064 New Products, Featured, et al...

You might try upgrading to v1.3.9h and see if in the processes this resolves the error ...

Do you have any Categories with both Products and Categories in it?

30 Sep 2011, 4:00 PM
#6
dwkettle avatar

dwkettle

New Zenner

Join Date:
Apr 2011
Location:
Saginaw, MI
Posts:
13
Plugin Contributions:
0

Re: How do I fix SQL syntax error 1064 New Products, Featured, et al...

I was told not to upgrade. That it could cause conflict in some of the files. So, I'm nervous about trying that.

Do you have any Categories with both Products and Categories in it?
Maybe. I should know this, right? I'll check.

1 Oct 2011, 2:16 PM
#7
dwkettle avatar

dwkettle

New Zenner

Join Date:
Apr 2011
Location:
Saginaw, MI
Posts:
13
Plugin Contributions:
0

Re: How do I fix SQL syntax error 1064 New Products, Featured, et al...

Zencart doesn't allow me to enter products in a category page, and vice versa.