Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2011
    Posts
    17
    Plugin Contributions
    0

    Default You have an error in your SQL syntax???

    Hey everyone,

    I just installed a new version of zencart 1.5.1. but I am getting this error:

    [04-Feb-2013 20:55:59 UTC] PHP Fatal 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 'int)PRODUCTS_OPTIONS_VALUES_TEXT_ID, 3, 'TEXT')' at line 1 :: INSERT INTO products_options_values (products_options_values_id, language_id, products_options_values_name) VALUES ((int)PRODUCTS_OPTIONS_VALUES_TEXT_ID, 3, 'TEXT') in ../public_html/ws54/includes/classes/db/mysql/query_factory.php on line 120
    At the time I got this problem I installed these mod's:

    Dutch Language Pack ZC 1.3.9 and 1.5.0
    Image_Handler4_v4_0
    Zen lightbox
    Admin_Login_As_Customer_v3.1_For_ZCv151
    css_js_loader
    fec
    sales_report_graphs_v1.04
    Monthly_Sales-Tax_Summary-v1.4
    edit_orders_v4.0.4

    Also I transferred my database but only the customer/order related tables and the product/categories related data. I first made an update of my database 1.9.3 and then started to replace parts of the original 1.5.1 database with it.

    After a while everything worked well and I was quite pleased with it, until I wanted to ad an attribute to one of my products and I got this message.

    WARNING: An Error occurred, please refresh the page and try again.
    The same happens when I go to the option name manager, option value manager etc.

    I tried to solve the problem but no luck!

    does anyone know how to solve this thing?

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: You have an error in your SQL syntax???

    Also I transferred my database but only the customer/order related tables
    You should import a current "COMPLETE" databse and re-run zc_install and select upgrade database only
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Jul 2011
    Posts
    17
    Plugin Contributions
    0

    Default Re: You have an error in your SQL syntax???

    Quote Originally Posted by kobra View Post
    You should import a current "COMPLETE" databse and re-run zc_install and select upgrade database only
    Well that's not really an option as my old database is completely messed-up (I mean really messed up), now everything works fine except for this error and I'm not sure if its really the database that's responsible for the error.

  4. #4
    Join Date
    Jul 2011
    Posts
    17
    Plugin Contributions
    0

    Default Re: You have an error in your SQL syntax???

    Ok, I am one step closer to solving the problem.

    Hopefully someone can help me because I really need to get the new website online since the upcoming season will be the most important one for us.

    When I imported the database as described in my previous post, I did not see any of the products at first.
    Then I found out that the products are loaded based on the languages_id. In my old database that was language id 4, foolishly I had deleted every language except the Dutch one. In my new database I had id number 3 for Dutch. As I only had the product descriptions etc. in Dutch I changed the id number for Dutch to 4. This solved all the problems I had and the products showed up quite nicely.

    Later however, I found out that none of the product attribute options are working, except for "Option Name Sorter" and "Option Value Sorter" which are new to 1.5.1 and therefore are still linked to the id number for English from the new installation.

    Today I simply transferred the whole database from this new installation to a clean installation of zencart, the basic language being English. When I use the English admin control, add a product etc. all attribute options are working, once I switch to the Dutch language in the admin the same problems occur.

    The error message I get says that it is trying to:
    INSERT INTO products_options_values (products_options_values_id, language_id, products_options_values_name) VALUES ((int)PRODUCTS_OPTIONS_VALUES_TEXT_ID, 3, 'TEXT') in ../public_html/ws54/includes/classes/db/mysql/query_factory.php on line 120
    so its doing something with language id number 3 instead of 4. But where does it get this 3 from, or maybe the question should be: why is it trying to use language id 3 (for English) for an attribute with language id 4?

    So what is going on, I'm really lost here.

    Ps the link to the new site at this moment is: www. plantmania .nl /ws2 (delete spaces)

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

    Default Re: You have an error in your SQL syntax???

    .

    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.

  6. #6
    Join Date
    Jul 2011
    Posts
    17
    Plugin Contributions
    0

    Default Re: You have an error in your SQL syntax???

    thanks!

    It works perfectly!

    Luckily it was not a database problem, sometime things can be so simple. now I'm yet another step closer to get the new site on-line

 

 

Similar Threads

  1. Replies: 1
    Last Post: 2 Dec 2011, 07:22 AM
  2. Replies: 1
    Last Post: 25 Aug 2011, 05:58 AM
  3. Replies: 8
    Last Post: 28 Jun 2011, 08:42 AM
  4. 1064 You have an error in your SQL syntax;
    By ndr2010 in forum Managing Customers and Orders
    Replies: 1
    Last Post: 16 Apr 2010, 07:39 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