Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2011
    Posts
    339
    Plugin Contributions
    0

    Default Unknown Error On Category Pages

    I'm having a small problem with www.jogrant.com. The index page looks great. The individual story listings look great. The three category pages are not displaying quite accurately...the descriptions are extending into the right sidebar (which is empty), and this message is appearing at the bottom of the pages: WARNING: An Error occurred, please refresh the page and try again.

    Refreshing the pages doesn't help. The error log baffles me; I can't figure out where the error is. It says:

    [29-Apr-2015 21:46:00 America/Chicago] 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 'from products p, products_description pd
    where p.products_id = pd.p' at line 3 :: select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name,
    p.products_date_added, p.products_price, p.products_type, p.master_categories_id ,pd.products_description from products p, products_description pd
    from products p, products_description pd
    where p.products_id = pd.products_id
    and pd.language_id = '1'
    and p.products_status = 1 order by rand()
    and p.products_id in (1, 2) ==> (as called by) /home2/boruma/public_html/jogrant.com/includes/modules/new_products.php on line 50 <== in /home2/boruma/public_html/jogrant.com/includes/classes/db/mysql/query_factory.php on line 155



    Anyone have any ideas? Thanks!!
    Last edited by DK_Scully; 30 Apr 2015 at 03:51 AM.

  2. #2
    Join Date
    Jan 2011
    Posts
    339
    Plugin Contributions
    0

    Default Re: Unknown Error On Category Pages

    This is the code I've been using on several different websites, and it's worked perfectly until now. That's why I'm confused...why is it suddenly malfunctioning now?

    $new_products_query = "select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name,
    p.products_date_added, p.products_price, p.products_type, p.master_categories_id ,pd.products_description from " . TABLE_PRODUCTS . " p, " .
    TABLE_PRODUCTS_DESCRIPTION . " pd
    from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
    where p.products_id = pd.products_id
    and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
    and p.products_status = 1 order by rand()
    and p.products_id in (" . $list_of_products . ")";

  3. #3
    Join Date
    Sep 2005
    Location
    Waikato, New Zealand
    Posts
    1,539
    Plugin Contributions
    3

    Default Re: Unknown Error On Category Pages

    Quote Originally Posted by DK_Scully View Post
    This is the code I've been using on several different websites, and it's worked perfectly until now. That's why I'm confused...why is it suddenly malfunctioning now?

    $new_products_query = "select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name,
    p.products_date_added, p.products_price, p.products_type, p.master_categories_id ,pd.products_description from " . TABLE_PRODUCTS . " p, " .
    TABLE_PRODUCTS_DESCRIPTION . " pd
    from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
    where p.products_id = pd.products_id
    and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
    and p.products_status = 1 order by rand()
    and p.products_id in (" . $list_of_products . ")";

    That code looks wrong the from statement is repeated
    Webzings Design
    Semi retired from Web Design

  4. #4
    Join Date
    Jan 2011
    Posts
    339
    Plugin Contributions
    0

    Default Re: Unknown Error On Category Pages

    What I did was copy the new_products.php file from another site that was working properly, and uploaded it directly to this new site. Why would it work on several other sites, but not on this one? What would cause the code to suddenly double?

    I did a direct side-by-side comparison of the code used on the other sites...where it's working properly...and this site where it's not. The code is identical.
    Last edited by DK_Scully; 30 Apr 2015 at 01:14 PM.

  5. #5
    Join Date
    Sep 2005
    Location
    Waikato, New Zealand
    Posts
    1,539
    Plugin Contributions
    3

    Default Re: Unknown Error On Category Pages

    I don't know why it would change, but that change with the duplicate from statement would give that error

    $new_products_query = "select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name,
    p.products_date_added, p.products_price, p.products_type, p.master_categories_id ,pd.products_description
    from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
    from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
    where p.products_id = pd.products_id
    and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
    and p.products_status = 1 order by rand()
    and p.products_id in (" . $list_of_products . ")";

    Perhaps delete the file on the server and confirm its deleted by requesting the page that uses it, and then upload the new one that you know works.

    If that doesn't work

    Go into your hosting control panels file manager, open the file and check the code is correct within the file there

    $new_products_query = "select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name,
    p.products_date_added, p.products_price, p.products_type, p.master_categories_id ,pd.products_description
    from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
    where p.products_id = pd.products_id
    and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
    and p.products_status = 1 order by rand()
    and p.products_id in (" . $list_of_products . ")";
    Webzings Design
    Semi retired from Web Design

  6. #6
    Join Date
    Jan 2011
    Posts
    339
    Plugin Contributions
    0

    Default Re: Unknown Error On Category Pages

    No, I guess I didn't explain myself well enough. The code above is working perfectly on 8 other shopping carts. That exact code, with the apparent duplication in it. I will do as you recommended, and delete the file and then re-upload it...but why would it be working perfectly well on 8 other sites if there's bad code in it?

  7. #7
    Join Date
    Sep 2005
    Location
    Waikato, New Zealand
    Posts
    1,539
    Plugin Contributions
    3

    Default Re: Unknown Error On Category Pages

    Don't know why, but i can confirm that if I duplicate that particular line in my code on the new_products page I get that same issue and the same error log

    Code:
    [30-Apr-2015 21:47:16] 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 'from znc_products p, znc_products_description pd
    where p.products_id = pd.produc' at line 3 :: select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name,
    p.products_date_added, p.products_price, p.products_type, p.master_categories_id ,pd.products_description from znc_products p, znc_products_description pd
    from znc_products p, znc_products_description pd
    where p.products_id = pd.products_id
    and pd.language_id = '1'
    and p.products_status = 1 order by rand()
    and p.products_id in (1, 2, 3) in /path to queryfactory thingie
    If I remove the duplicated line as below

    $new_products_query = "select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name,
    p.products_date_added, p.products_price, p.products_type, p.master_categories_id ,pd.products_description
    from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
    where p.products_id = pd.products_id
    and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
    and p.products_status = 1 order by rand()
    and p.products_id in (" . $list_of_products . ")";

    my page show like this (which i assume is correct?)

    I get new product appearing below the listing and no error message

    http://www.grumpykiwi.com//index.php...=index&cPath=1
    Webzings Design
    Semi retired from Web Design

 

 

Similar Threads

  1. Replies: 1
    Last Post: 1 Apr 2011, 12:54 AM
  2. Error 320 (net::ERR_INVALID_RESPONSE): Unknown error.
    By suehigman in forum Installing on a Windows Server
    Replies: 1
    Last Post: 4 Feb 2009, 10:16 PM
  3. Decimal quantities error on category pages
    By aeolidia in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 30 Sep 2008, 09:46 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