Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14
  1. #11
    Join Date
    Feb 2007
    Posts
    224
    Plugin Contributions
    0

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

    Quote Originally Posted by mc12345678 View Post
    As would be expected, but how does it compare to a vanilla version following the process that has been used over the last several posts?

    It is this file that is last to create the sql query that is causing the error to occur. Also, some templates have been known to modify the file which is a core file.
    it is different, among the changes the snippet below
    // BOF View All Changes 1 of 3
    if ($page == 'all') {
    $this->page_all = true;
    $override = $db->Execute($query);
    $max_rows = $override->RecordCount();
    }
    // EOF View All Changes 1 of 3

    I replaced the file with the original one and i tested and i got the same error in the log file and nothing changed in displaying the featured products, still showing the Warning. I do not see any harm yet except i have to clean the log directory more often, i think i will concentrate my effort on the SEO part of the site, thank you all for your help and precious time.

  2. #12
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,668
    Plugin Contributions
    11

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

    Quote Originally Posted by TamyA View Post
    it is different, among the changes the snippet below
    // BOF View All Changes 1 of 3
    if ($page == 'all') {
    $this->page_all = true;
    $override = $db->Execute($query);
    $max_rows = $override->RecordCount();
    }
    // EOF View All Changes 1 of 3

    I replaced the file with the original one and i tested and i got the same error in the log file and nothing changed in displaying the featured products, still showing the Warning. I do not see any harm yet except i have to clean the log directory more often, i think i will concentrate my effort on the SEO part of the site, thank you all for your help and precious time.
    the harm is that when people look at your featured products page, they can not see all of the featured products as your SQL statement is failing.

    you are close to resolving this error and it is something that, IMO, you should fix.

    i would go over this thread again, and see if you missed something. alternatively, in the split classes file, on line 93, there is the following code:

    PHP Code:
    $this->sql_query .= " limit " . ($offset $offset ", " '') . $this->number_of_rows_per_page
    right after that line, you can add:
    PHP Code:
    error_log($this->sql_query); 
    then go to the featured products page to get the error. then there should be a new log file that has the exact SQL statement. you can post the results of the sql statement, and we can then see exactly where the error is. hopefully.

    do not forget to remove the added error_log line as it will just create numerous additional log files.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  3. #13
    Join Date
    May 2019
    Location
    Inverness, Florida
    Posts
    7
    Plugin Contributions
    0

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

    Quote Originally Posted by carlwhat View Post
    the harm is that when people look at your featured products page, they can not see all of the featured products as your SQL statement is failing.

    you are close to resolving this error and it is something that, IMO, you should fix.

    i would go over this thread again, and see if you missed something. alternatively, in the split classes file, on line 93, there is the following code:

    PHP Code:
    $this->sql_query .= " limit " . ($offset $offset ", " '') . $this->number_of_rows_per_page
    right after that line, you can add:
    PHP Code:
    error_log($this->sql_query); 
    then go to the featured products page to get the error. then there should be a new log file that has the exact SQL statement. you can post the results of the sql statement, and we can then see exactly where the error is. hopefully.

    do not forget to remove the added error_log line as it will just create numerous additional log files.
    I hope I can resurrect this thread as I am having the exact same problem. Exact same message.
    I have followed all of the suggestions in this thread with no luck.
    I added the line of code into the split_page_results.php as per the final suggestion.
    On examining the subsequent error log, it is the same with an additional line at the front which reads:

    [10-Jul-2019 13:28:23 America/Los_Angeles] limit 10

    Any help would be very much appreciated! Thanks

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

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

    Quote Originally Posted by Mazcrafter View Post
    I hope I can resurrect this thread as I am having the exact same problem. Exact same message.
    I have followed all of the suggestions in this thread with no luck.
    I added the line of code into the split_page_results.php as per the final suggestion.
    On examining the subsequent error log, it is the same with an additional line at the front which reads:

    [10-Jul-2019 13:28:23 America/Los_Angeles] limit 10

    Any help would be very much appreciated! Thanks
    Almost certainly comes from an addon/template you've installed which alters/overrides related core files. How exactly is your site different from original Zen Cart code? And what version?
    .

    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.

 

 
Page 2 of 2 FirstFirst 12

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. 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
  3. Replies: 1
    Last Post: 25 Aug 2011, 05:58 AM
  4. Error message 1064 you have an error in your sql syntax
    By honrheart in forum General Questions
    Replies: 1
    Last Post: 11 Sep 2009, 02:38 AM
  5. 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

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