Results 1 to 10 of 10
  1. #1
    Join Date
    Dec 2003
    Location
    Denver Colorado
    Posts
    63
    Plugin Contributions
    0

    Default Fatal error: mysql error (1064 error) -- v1.0-alpha

    I have a cart that has been working correctly for some time. I'm not sure what version it is but I suspect it's an older version. (Where do I find the version?) When we try to add products to the catalog we now get the following error when we go into the Catalog>Categories / Products section. Does anybody have any idea what has caused this error and what we need to do to fix it.


    Fatal error: mysql 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 '-10, 10' at line 1] in EXECUTE("select p.products_id, pd.products_name, p.products_model, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.products_quantity_order_min, p.products_quantity_order_units, p.products_priced_by_attribute, p.product_is_free, p.product_is_call, p.products_quantity_mixed, p.products_quantity_order_max from products p, products_description pd, products_to_categories p2c where p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = '0' order by pd.products_name limit -10, 10") in /home/roadware/public_html/includes/classes/adodb/adodb-errorhandler.inc.php on line 139

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Fatal error: mysql error (1064 error)

    Yes, you definitely have a *very* old version -- something prior to v1.2.0.
    You can see the version number under Admin->Tools->Server Info

    Were there any recent changes to your hosting plan ? ie: a switch to newer PHP or MySQL versions?

    Were there any recent customizations installed on your site?

    Does running a Database Repair via phpMyAdmin (on each table individually) or cPanel (entire database) solve the problem?
    .

    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.

  3. #3
    Join Date
    Dec 2003
    Location
    Denver Colorado
    Posts
    63
    Plugin Contributions
    0

    Default Re: Fatal error: mysql error (1064 error) -- v1.1x

    I tride the suggestions you gave but they didn't work. I suspect the mysql database has been updated. the problem hasn't showed up before because they haven't added products sence 2004.

    I checked the version and it says "Zencart Alpha Relese" so it is old and needs updated. Mysql is version 4.4.2.

    I coppied lines 129 through 139 from the file below. It says the error is on 129. I suspect the error is somewhere in that code but I'm not a PHP expert. Does anybody see anything that needs to be changed to make this work untill we have time to upgrade.


    if (defined('ADODB_ERROR_LOG_TYPE')) {

    $t = date('Y-m-d H:i:s');

    if (defined('ADODB_ERROR_LOG_DEST'))

    error_log("($t) $s", DODB_ERROR_LOG_TYPE, ADODB_ERROR_LOG_DEST);

    else

    error_log("($t) $s", ADODB_ERROR_LOG_TYPE);

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Fatal error: mysql error (1064 error) -- v1.1x

    Try editing /admin/includes/classes/split_page_results.php
    on line 49 you have:
    Code:
          $offset = ($max_rows_per_page * ($current_page_number - 1));
    Insert a new line below it and add the following:
    Code:
    // fix offset error on some versions
          if ($offset < 0) { $offset = 0; }
    Hopefully this will stop the -10 from appearing, and start at 0 instead.
    .

    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.

  5. #5
    Join Date
    Dec 2003
    Location
    Denver Colorado
    Posts
    63
    Plugin Contributions
    0

    Default Re: Fatal error: mysql error (1064 error) -- v1.0-alpha

    DrByte
    Thank you very much! That fixed the problem.
    Thanks
    Dale

  6. #6
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Fatal error: mysql error (1064 error) -- v1.0-alpha

    You're welcome.

    I strongly recommend you upgrade. Considering you're working with such old code, I would suggest that your "upgrade" actually be a "redo" of the site, using the new code.
    .

    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.

  7. #7
    Join Date
    Dec 2003
    Location
    Denver Colorado
    Posts
    63
    Plugin Contributions
    0

    Default Re: Fatal error: mysql error (1064 error) -- v1.0-alpha

    I was also thinking it would be the best way. I'm wondering how much trouble it's goin to be to import the database into a new cart.

  8. #8
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Fatal error: mysql error (1064 error) -- v1.0-alpha

    Quote Originally Posted by Dale Schibbelhut View Post
    I was also thinking [upgrading] would be the best way. I'm wondering how much trouble it's goin to be to import the database into a new cart.
    Easy.
    Backup the old database.
    Import it to a new database for testing.
    Upgrade it.
    Customize the site (files etc)
    Then move the new 'files' to the old site, and upgrade the old database in-place.

    It's documented in the various instructions docs which can be found in the /docs folder of your Zen Cart files.
    .

    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.

  9. #9
    Join Date
    Nov 2010
    Posts
    1
    Plugin Contributions
    0

    Default Re: Fatal error: mysql error (1064 error) -- v1.0-alpha

    Hi!
    I've got this message,when i try to send a newsletter?
    Anyone knows the solution?

    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 'WHERE email_format != 'NONE' and confirmed = 1 and (customers_id IS NULL or cust' at line 1
    in:
    [SELECT email_address as customers_email_address FROM WHERE email_format != 'NONE' and confirmed = 1 and (customers_id IS NULL or customers_id = 0) order by email_address ]
    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.

  10. #10
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Fatal error: mysql error (1064 error) -- v1.0-alpha

    You've installed an addon that alters or adds records in the query_builder table, and now you've got something in there that's got bad syntax, and is thus triggering your error.
    .

    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.

 

 

Similar Threads

  1. v151 PHP Fatal error: 1064:You have an error in your SQL syntax
    By chaptech in forum General Questions
    Replies: 2
    Last Post: 5 Mar 2015, 07:16 PM
  2. v152 PHP Fatal error: 1064
    By welshop.com in forum General Questions
    Replies: 14
    Last Post: 10 Jun 2014, 04:58 PM
  3. PHP Fatal error: 1064:You have an error in your SQL syntax
    By uswebworx in forum General Questions
    Replies: 11
    Last Post: 19 Apr 2012, 09:17 AM
  4. MySQL Error 1064 You have an error in your SQL syntax;
    By dmm2020 in forum General Questions
    Replies: 2
    Last Post: 22 Feb 2009, 05:02 AM
  5. Dreaded mYSQL 1064 error when importing MySQL 4 database into MySQL5
    By dml311071 in forum Installing on a Linux/Unix Server
    Replies: 4
    Last Post: 10 Jun 2008, 05:38 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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR