Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    May 2004
    Posts
    766
    Plugin Contributions
    0

    Default New Products SQL Error

    Hi,
    I am getting this error when anyone clicks on the new products link:
    -------------------
    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 '-0, 0' at line 11
    in:
    [SELECT p.products_id, p.products_type, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status, p.master_categories_id FROM zen_products p LEFT JOIN zen_manufacturers m ON (p.manufacturers_id = m.manufacturers_id), zen_products_description pd WHERE p.products_status = 1 AND p.products_id = pd.products_id AND pd.language_id = 1 order by p.products_date_added DESC, pd.products_name limit -0, 0]
    ------------------
    Any idea where or how I would fix this?

    thank you,

    betty

    v1.38a with all the latest patches applied

  2. #2
    Join Date
    Apr 2007
    Location
    Herts. UK
    Posts
    890
    Plugin Contributions
    4

    Default Re: New Products SQL Error

    Log in to your Admin, click on the Configuration menu then Maximum values. What does it say against 'New Products Listing- Number Per Page'?

    Regards,
    Christian.

  3. #3
    Join Date
    May 2004
    Posts
    766
    Plugin Contributions
    0

    Default Re: New Products SQL Error

    It says 1.

    thank you,
    betty

    Quote Originally Posted by CJPinder View Post
    Log in to your Admin, click on the Configuration menu then Maximum values. What does it say against 'New Products Listing- Number Per Page'?

    Regards,
    Christian.

  4. #4
    Join Date
    Apr 2007
    Location
    Herts. UK
    Posts
    890
    Plugin Contributions
    4

    Default Re: New Products SQL Error

    Quote Originally Posted by bettysue View Post
    It says 1.
    Try changing that to a larger number like 10 and see if that fixes the problem.

    Regards,
    Christian.

  5. #5
    Join Date
    May 2004
    Posts
    766
    Plugin Contributions
    0

    Default Re: New Products SQL Error

    No that didn't fix it, I still get the same error message.

    thank you,

    betty

  6. #6
    Join Date
    Apr 2007
    Location
    Herts. UK
    Posts
    890
    Plugin Contributions
    4

    Default Re: New Products SQL Error

    Hmm..very odd. The SQL error you posted earlier would only occur if 'New Products Listing- Number Per Page' was set to 0. It also looks as if 'New Product Listing - Limited to ...' is also set to 0.

    If 'New Products Listing- Number Per Page' is set to something other than zero then it could be that the Configuration table in your database has become corrupt. Do you have a recent backup of your database from before the error started happening?

    Regards,
    Christian.

  7. #7
    Join Date
    May 2004
    Posts
    766
    Plugin Contributions
    0

    Default Re: New Products SQL Error

    The main issue is that the site owner doesn't know how long it has been doing this. There are database backups but since we cannot put a finger on when it started, there would be no way to tell which database to restore. Plus he said he has made changes to the site over the past couple of weeks that he doesn't want to lose which a db restore would do.

    Is there any other method other than a restore to fix it?

    thank you,
    betty



    Quote Originally Posted by CJPinder View Post
    Hmm..very odd. The SQL error you posted earlier would only occur if 'New Products Listing- Number Per Page' was set to 0. It also looks as if 'New Product Listing - Limited to ...' is also set to 0.

    If 'New Products Listing- Number Per Page' is set to something other than zero then it could be that the Configuration table in your database has become corrupt. Do you have a recent backup of your database from before the error started happening?

    Regards,
    Christian.

  8. #8
    Join Date
    Apr 2007
    Location
    Herts. UK
    Posts
    890
    Plugin Contributions
    4

    Default Re: New Products SQL Error

    First thing we can try is replacing the specific configuration key that might be causing the problem. Take a backup of the database then carefully copy and paste the following into Admin->Tools->Install SQL Patches and click Send :
    Code:
    DELETE FROM `configuration` where configuration_title='New Products Listing- Number Per Page';
    INSERT INTO `configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('New Products Listing- Number Per Page', 'MAX_DISPLAY_PRODUCTS_NEW', '10', 'Number of new products listed per page', '3', '14', now());
    Let me know if that fixes the problem.

    Regards,
    Christian.

  9. #9
    Join Date
    May 2004
    Posts
    766
    Plugin Contributions
    0

    Default Re: New Products SQL Error

    That did it

    Thank you so much for the help and the fix. It is greatly appreciated.

    betty

  10. #10
    Join Date
    Apr 2007
    Location
    Herts. UK
    Posts
    890
    Plugin Contributions
    4

    Default Re: New Products SQL Error

    I'm glad you've got the problem fixed. Unfortunately it may indicate that there has been some database corruption. It might have been a isolated incident or it could be an ongoing issue. Sometimes these things can also happen if an add-on is installed incorrectly. I would talk with your website host and ask if they have had any problems with the database server.

    Normally I would recommend restoring from the last known good backup. If you don't know which backup that is then it gets a bit tricky. If you have copies of previous backups then you could try restoring some of them to a test site to see if you can pinpoint the date on which the problem appeared.

    If the last good backup was a long time ago then you probably don't want to convert back to it and lose the recent customer and order information. You could just restore the Configuration table though as that is where the corrupt New Products key was and the contents of that table do not change often.

    Regards,
    Christian.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 6
    Last Post: 1 Oct 2011, 03:16 PM
  2. New Products has SQL error message
    By lilguppy in forum General Questions
    Replies: 7
    Last Post: 29 Jun 2010, 07:46 PM
  3. [Done v1.3.9a] New Products... results in SQL Error
    By llemberg in forum Bug Reports
    Replies: 6
    Last Post: 5 Dec 2009, 05:43 PM
  4. Replies: 2
    Last Post: 16 Sep 2009, 06:15 PM
  5. home > new products get SQL error
    By keylesslocks in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 20 Oct 2008, 09:57 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR