If this is your first visit, check our documentation. To post, register or login.

Error 1064

Started by solver on 10 May 2012, 10:43 PM · Views: 785

Results 1 to 5 of 5
10 May 2012, 10:43 PM
#1
solver avatar

solver

New Zenner

Join Date:
May 2012
Posts:
3
Plugin Contributions:
0

Post #1 by solver

Hello everyone!

First of all, I am new to zen cart and this is my first post. Please forgive me if this question has been asked before, but I couldn't directly find any posts with a solution to my problem.

My problem is, that when I add products to my sub-categories, I get the following 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 products p, 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 ()]

The categories structure to my site (currently) is as follows:

**Category 1 - 1. Sub-Category 1
2. Sub-Category 2

Category 2 - 1. Sub-Category 1 - - Product 1

  • Product 2
  1. Sub-Category 2

Category 3 - 1. Sub-Category 1
2. Sub-Category 2**

I've googled the problem, and can't find anyone with a solution, although I did find a number of websites with the same problem. On a different forum post, it was recommended (as a temporary measure) to turn on strict error reporting.

Here's a link to my site where the error message is displayed: http://www.my-cpu.com/index.php?main_page=index&cPath=69

The website is still in development, but I have noticed that on every page that this error message is displayed, both "navColumnTwo" & the "footer" are now not displayed. I'm very confused and i'm hoping someone can help me with this problem.

Thanks in advance!

Shaun.

11 May 2012, 1:23 AM
#2
drbyte avatar

drbyte

Sensei

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

Post #2 by drbyte

That's your "New Products" center-box trying to output data but having trouble finding suitable data.

How did you get your products and categories into your store? Did you enter them by hand using the Admin Categories/Products screens? Or some other way?

What have you set for the "new products" criteria?
http://www.zen-cart.com/content.php?45-what-determines-if-a-product-is-new-%28new-products-for-xxxxx-month%29
http://www.zen-cart.com/content.php?46-i-want-to-enable-disable-the-new-products-for-insert-month-or-featured-special-upcoming-products-sections

What addons have you installed?

.
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.

11 May 2012, 9:10 AM
#3
solver avatar

solver

New Zenner

Join Date:
May 2012
Posts:
3
Plugin Contributions:
0

Post #3 by solver

Hi DrByte,

First of all, thank you for your response.

I got the products onto my store using the Admin Panel "Categories/Products Pages".

The criteria set for the "new products" are as follows:

  • New Product Listing - Limited to "0" (all products)
  • Index Listing - Everything is set to "show" other than "Filter Product Listing for Current Top Level Category When Enabled" which is set to "0"

I currently have no addons installed.

I'm not really sure what file/files I should be looking for, but I have compared my "tpl_modules_products_new_listing.php" & "tpl_products_new_default.php" files to the original Zen Cart files using "kdiff3", which display that there are no differences between mine and the original.

Are there any other files that I should be comparing?

Thanks,

Shaun.

11 May 2012, 12:58 PM
#4
drbyte avatar

drbyte

Sensei

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

Post #4 by drbyte

Okay, if you've not installed any addons, then which files have you changed, or added, and why? Starting with anything under the /includes/ folder.

I can't recreate your symptoms on my fresh clean install of v1.5.0, and thousands of live stores aren't reporting the problem.

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

.
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.

11 May 2012, 2:24 PM
#5
solver avatar

solver

New Zenner

Join Date:
May 2012
Posts:
3
Plugin Contributions:
0

Post #5 by solver

Hi DrByte,

I've just managed to resolve my problem! Using a file comparison app, it displayed that 3 lines differed on my "new_products.php" within "includes/modules/MY_CUSTOM_TEMPLATE/". These 3 errors included:

Line #38 $list_of_products = substr($list_of_products, 0, 0); // remove trailing comma
Line #75 if ($col > (SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS - 0)) {
Line #89 $zc_show_new_products = false;

The Correct lines are:

Line #38 $list_of_products = substr($list_of_products, 0, -2); // remove trailing comma
Line #75 if ($col > (SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS - 1)) {
Line #89 $zc_show_new_products = true;

Thank you for you help!

Shaun.