Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2012
    Posts
    6
    Plugin Contributions
    0

    application error 1064 You have an error in your SQL syntax

    Gentlemen,

    the following appears while trying to restrict the coupon within the admin panel:

    Code:
    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, MAX_DISPLAY_RESTRICT_ENTRIES' at line 1
    in:
    [select * from data_coupon_restrict where coupon_id = '1' and category_id != '0' limit -0, MAX_DISPLAY_RESTRICT_ENTRIES]

    Last steps i been doing before having this issue:
    Moving entire zen cart into another server, including mySQL

    I assume, while reading the output, there is a new syntax necessary as of another mySQL version?

    All other functions of the website are 100% working.

    Thanks for your assistance

  2. #2
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

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

    Quote Originally Posted by uniquely View Post
    for the right syntax to use near '-0, MAX_DISPLAY_RESTRICT_ENTRIES' at line 1
    The syntax error is the "limit -0".

    Quote Originally Posted by uniquely View Post
    I assume, while reading the output, there is a new syntax necessary as of another mySQL version?
    TTBOMK a negative limit is 'illegal' in all MySQL versions. I'd be more interested in how a negative zero could be derived. It's bad code somewhere, and quite probably not the direct result of your move. Perhaps one of your DB tables didn't get transferred correctly?

    Cheers
    Rod

  3. #3
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

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

    Go to your Tools ... Developers Tool Kit ... and in the bottom input box enter:
    MAX_DISPLAY_RESTRICT_ENTRIES

    Select Admin and click SEARCH ...

    Do you have a define for this constant? What is it set to?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  4. #4
    Join Date
    Jun 2012
    Posts
    6
    Plugin Contributions
    0

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

    Hey,

    thanks for your reply! Following echo after searching for MAX_DISPLAY_RESTRICT_ENTRIES:

    In the coupon_restrict.php
    Code:
    Line #8 : //define('MAX_DISPLAY_RESTRICT_ENTRIES', 10);
    
    Line #172 : $cr_split = new splitPageResults($_GET['cpage'], MAX_DISPLAY_RESTRICT_ENTRIES, $cr_query_raw, $cr_query_numrows);
    
    Line #216 : <td class="smallText" valign="top"><?php echo $cr_split->display_count($cr_query_numrows, MAX_DISPLAY_RESTRICT_ENTRIES, $_GET['cpage'], TEXT_DISPLAY_NUMBER_OF_CATEGORIES); ?></td>
    
    Line #217 : <td class="smallText" align="right"><?php echo $cr_split->display_links($cr_query_numrows, MAX_DISPLAY_RESTRICT_ENTRIES, MAX_DISPLAY_PAGE_LINKS, $_GET['cpage'],zen_get_all_get_params(array('cpage','action', 'x', 'y')),'cpage'); ?></td>
    
    Line #266 : $pr_split = new splitPageResults($_GET['ppage'], MAX_DISPLAY_RESTRICT_ENTRIES, $pr_query_raw, $pr_query_numrows);
    
    Line #306 : <td class="smallText" valign="top"><?php echo $pr_split->display_count($pr_query_numrows, MAX_DISPLAY_RESTRICT_ENTRIES, $_GET['ppage'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
    
    Line #307 : <td class="smallText" align="right"><?php echo $pr_split->display_links($pr_query_numrows, MAX_DISPLAY_RESTRICT_ENTRIES, MAX_DISPLAY_PAGE_LINKS, $_GET['ppage'],zen_get_all_get_params(array('ppage','action', 'x', 'y')),'ppage'); ?></td>
    as well too times:
    Code:
    Line #27 : define('MAX_DISPLAY_RESTRICT_ENTRIES', 20);
    Code:
    Line #28 : define('MAX_DISPLAY_RESTRICT_ENTRIES', 20);
    May possible to just change the sql value to "0" instead of "-0" or will it automatically rewrite it again?

  5. #5
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

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

    This should be in the file:
    /your_secret_admin/includes/languages/english/coupon_restrict.php

    Code:
    Line #27 : define('MAX_DISPLAY_RESTRICT_ENTRIES', 20);
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  6. #6
    Join Date
    Jun 2012
    Posts
    6
    Plugin Contributions
    0

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

    ok ok sorry to bother wasting your time...

    i just included another language to my zen cart and i should simply compare the files!

    missed the line in the dutch coupon_restrict!

    Works fine now thank you so much Ajeh!

  7. #7
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

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

    You are most welcome ... thanks for the update that this is now working for you ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 

Similar Threads

  1. v151 1064:You have an error in your SQL syntax;
    By holsterland in forum General Questions
    Replies: 5
    Last Post: 5 May 2014, 11:58 PM
  2. 1064 You have an error in your SQL syntax
    By Delights in forum Installing on a Linux/Unix Server
    Replies: 1
    Last Post: 8 Aug 2010, 10:06 PM
  3. 1064 You have an error in your SQL syntax
    By phastings in forum General Questions
    Replies: 1
    Last Post: 18 Dec 2008, 06:12 AM
  4. 1064 You have an error in your SQL syntax;
    By aerosmith in forum General Questions
    Replies: 3
    Last Post: 3 Sep 2008, 06:55 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