Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2005
    Posts
    4
    Plugin Contributions
    0

    Default 1064 error when I add 13 products to the basket (xsell mod query error)

    Hi I hope someone can help when I add 13 products to the shopping basket 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 '-1)' at line 1
    in:
    [(select p.products_id, p.products_image from zen_products_xsell xp, zen_products p, zen_products_description pd where xp.products_id = '14045' and xp.xsell_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '1' and p.products_status = '1' order by xp.products_id asc limit 2)

    The site is running on:
    Zen Cart 1.3.7
    Database Patch Level: 1.3.7

    The URL for the site is:
    http://www.cdandvinyl.co.uk

    Any help would be greatly appreciated.

    Thanks
    Chris

  2. #2
    Join Date
    Oct 2007
    Posts
    52
    Plugin Contributions
    0

    Default Re: 1064 error when I add 13 products to the basket (xsell mod query error)

    I am getting a similar problem in admin when I run optimise database under tools store manager quote below

    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 '-footwear_co_uk_welly' at line 1
    in:
    [SHOW TABLE STATUS FROM easy-footwear_co_uk_welly]
    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 found this thread on the Os commerce site
    forums.oscommerce.com/index.php?showtopic=144095&st=0

    But I am struggling to find which php file I should change
    Jimmy6Bellies

  3. #3
    Join Date
    Oct 2007
    Posts
    52
    Plugin Contributions
    0

    Default Re: 1064 error when I add 13 products to the basket (xsell mod query error)

    Ok split page results is in zencart with the same structure as Os so I think you can fix it by changing
    $this->sql_query .= " limit " . $offset . ", " . $this->number_of_rows_per_page;

    to this

    $this->sql_query .= " limit " . max($offset, 0) . ", " . $this->number_of_rows_per_page


    Note the bit to change = $offset to max($offset, 0)
    Jimmy6Bellies

  4. #4
    Join Date
    Jan 2004
    Posts
    58,280
    Blog Entries
    3
    Plugin Contributions
    106

    Default Re: 1064 error when I add 13 products to the basket (xsell mod query error)

    Quote Originally Posted by morrie View Post
    Hi I hope someone can help when I add 13 products to the shopping basket 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 '-1)' at line 1
    in:
    [(select p.products_id, p.products_image from zen_products_xsell xp, zen_products p, zen_products_description pd where xp.products_id = '14045' and xp.xsell_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '1' and p.products_status = '1' order by xp.products_id asc limit 2)

    The site is running on:
    Zen Cart 1.3.7
    Database Patch Level: 1.3.7

    The URL for the site is:
    http://www.cdandvinyl.co.uk

    Any help would be greatly appreciated.

    Thanks
    Chris
    Quote Originally Posted by James O View Post
    Ok split page results is in zencart with the same structure as Os so I think you can fix it by changing
    $this->sql_query .= " limit " . $offset . ", " . $this->number_of_rows_per_page;

    to this

    $this->sql_query .= " limit " . max($offset, 0) . ", " . $this->number_of_rows_per_page


    Note the bit to change = $offset to max($offset, 0)
    The "real" fix is to deal with whatever setting in the xsell addon is set to 0 or left blank. Might also be good to alter the xsell addon so that it knows not to send an invalid value to the database.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donations always welcome: www.zen-cart.com/donate

    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.

  5. #5
    Join Date
    Jan 2004
    Posts
    58,280
    Blog Entries
    3
    Plugin Contributions
    106

    Default Re: 1064 error when I add 13 products to the basket (xsell mod query error)

    Quote Originally Posted by James O View Post
    I found this thread on the Os commerce site
    forums.oscommerce.com/index.php?showtopic=144095&st=0

    But I am struggling to find which php file I should change
    A Zen Cart forum search for "optimize show table status from" brings up this thread which has the solution you require. No need to search elsewhere :)
    http://www.zen-cart.com/forum/showthread.php?t=100191
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donations always welcome: www.zen-cart.com/donate

    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.

  6. #6
    Join Date
    Oct 2007
    Posts
    52
    Plugin Contributions
    0

    Default Re: 1064 error when I add 13 products to the basket (xsell mod query error)

    Thank you Dr Byte thats my problem solved

    james
    Jimmy6Bellies

  7. #7
    Join Date
    Jan 2010
    Posts
    1
    Plugin Contributions
    0

    Default Re: 1064 error when I add 13 products to the basket (xsell mod query error)

    I tired link fix from DrByte but I am still getting 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 '-2)' at line 1
    in:
    [(select p.products_id, p.products_image from products_xsell xp, products p, products_description pd where xp.products_id = '33' and xp.xsell_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '1' and p.products_status = '1' order by xp.products_id asc limit 2) UNION (select p.products_id, p.products_image from products_xsell xp, products p, products_description pd where xp.products_id = '34' and xp.xsell_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '1' and p.products_status = '1' order by xp.products_id asc limit 2) UNION (select p.products_id, p.products_image from products_xsell xp, products p, products_description pd where xp.products_id = '35' and xp.xsell_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '1' and p.products_status = '1' order by xp.products_id asc limit 2) UNION (select p.products_id, p.products_image from products_xsell xp, products p, products_description pd where xp.products_id = '36' and xp.xsell_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '1' and p.products_status = '1' order by xp.products_id asc limit 2) UNION (select p.products_id, p.products_image from products_xsell xp, products p, products_description pd where xp.products_id = '37' and xp.xsell_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '1' and p.products_status = '1' order by xp.products_id asc limit 2) UNION (select p.products_id, p.products_image from products_xsell xp, products p, products_description pd where xp.products_id = '32' and xp.xsell_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '1' and p.products_status = '1' order by xp.products_id asc limit 2) UNION (select p.products_id, p.products_image from products_xsell xp, products p, products_description pd where xp.products_id = '39' and xp.xsell_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '1' and p.products_status = '1' order by xp.products_id asc limit 2) UNION (select p.products_id, p.products_image from products_xsell xp, products p, products_description pd where xp.products_id = '40' and xp.xsell_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '1' and p.products_status = '1' order by xp.products_id asc limit 2) UNION (select p.products_id, p.products_image from products_xsell xp, products p, products_description pd where xp.products_id = '41' and xp.xsell_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '1' and p.products_status = '1' order by xp.products_id asc limit 2) UNION (select p.products_id, p.products_image from products_xsell xp, products p, products_description pd where xp.products_id = '42' and xp.xsell_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '1' and p.products_status = '1' order by xp.products_id asc limit 2) UNION (select p.products_id, p.products_image from products_xsell xp, products p, products_description pd where xp.products_id = '325' and xp.xsell_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '1' and p.products_status = '1' order by xp.products_id asc limit 2) UNION (select p.products_id, p.products_image from products_xsell xp, products p, products_description pd where xp.products_id = '327' and xp.xsell_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '1' and p.products_status = '1' order by xp.products_id asc limit 2) UNION (select p.products_id, p.products_image from products_xsell xp, products p, products_description pd where xp.products_id = '326' and xp.xsell_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '1' and p.products_status = '1' order by xp.products_id asc limit 2) UNION (select p.products_id, p.products_image from products_xsell xp, products p, products_description pd where xp.products_id = '328' and xp.xsell_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '1' and p.products_status = '1' order by xp.products_id asc limit -2)]

 

 

Similar Threads

  1. Fatal error: mysql error (1064 error) -- v1.0-alpha
    By Dale Schibbelhut in forum General Questions
    Replies: 9
    Last Post: 18 Nov 2010, 08:08 PM
  2. Replies: 3
    Last Post: 21 Sep 2008, 12:45 AM
  3. error message 1064 you have an error in your sql syntax
    By ngsl in forum General Questions
    Replies: 0
    Last Post: 22 Aug 2008, 06:44 AM

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
  •