Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2007
    Posts
    12
    Plugin Contributions
    0

    Default 1054 Unknown column 'p.products_id' in 'on clause'

    1054 Unknown column 'p.products_id' in 'on clause'

    This is what i get after i try to add any product to any category

    I am using the basic template that come with the shopping cart

    Can anyone point me in the right direction?
    What code and where do i need to put tem to fix this?

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

    Default Re: 1054 Unknown column 'p.products_id' in 'on clause'

    What version of Zen Cart are you using?
    What version of PHP ?
    What version of MySQL ?
    Have you installed any contributions/mods/customizations, whether related to template or not?


    That's a typical problem with MySQL 5 and older versions of Zen Cart or older contributions.
    .

    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
    Mar 2006
    Posts
    6
    Plugin Contributions
    0

    Default Re: 1054 Unknown column 'p.products_id' in 'on clause'

    I'm still using Zen Cart v1.2.7 and I solved this problem by fixing one query in the includes/modules/meta_tags.php:

    Find (around line 181):
    Code:
    case (strstr($_GET['main_page'], 'product_') or strstr($_GET['main_page'], 'document_')):
        $sql= "select pd.products_name, p.products_model, p.products_price_sorter, p.products_tax_class_id,
                                          p.metatags_title_status, p.metatags_products_name_status, p.metatags_model_status,
                                          p.products_id, p.metatags_price_status, p.metatags_title_tagline_status,
                                          pd.products_description,
                                          mtpd.metatags_title, mtpd.metatags_keywords, mtpd.metatags_description
                                  from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_META_TAGS_PRODUCTS_DESCRIPTION . " mtpd on mtpd.products_id = p.products_id and mtpd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                                  where p.products_id = '" . (int)$_GET['products_id'] . "'
                                  and p.products_id = pd.products_id
                                  and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
    change to:
    Code:
    case (strstr($_GET['main_page'], 'product_') or strstr($_GET['main_page'], 'document_')):
        $sql= "select pd.products_name, p.products_model, p.products_price_sorter, p.products_tax_class_id,
                                          p.metatags_title_status, p.metatags_products_name_status, p.metatags_model_status,
                                          p.products_id, p.metatags_price_status, p.metatags_title_tagline_status,
                                          pd.products_description, p.product_is_free,
                                          mtpd.metatags_title, mtpd.metatags_keywords, mtpd.metatags_description
                                  from (" . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd) left join " . TABLE_META_TAGS_PRODUCTS_DESCRIPTION . " mtpd on mtpd.products_id = p.products_id and mtpd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                                  where p.products_id = '" . (int)$_GET['products_id'] . "'
                                  and p.products_id = pd.products_id
                                  and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
    Regards.

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

    Default Re: 1054 Unknown column 'p.products_id' in 'on clause'

    thanks MARcoDEN, but in this case, the cause has nothing to do with meta-tags.
    .

    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

    Default Re: 1054 Unknown column 'p.products_id' in 'on clause'

    Can you tell me Dr Byte what you think it has to do with??
    1054 Unknown column 'p.products_id' in 'on clause'
    I'm getting the same error on v 1.2.7 locally iis on XP mysql 5.0
    Regards
    emmdee
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  6. #6
    Join Date
    Nov 2006
    Location
    Papworth, Cambridgeshire, UK
    Posts
    731
    Plugin Contributions
    3

    Default Re: 1054 Unknown column 'p.products_id' in 'on clause'

    it has to do with running version 1.2.7 with MySQL 5. Not impossible to fix, but probably easier to use version 1.3.7? Version 1.2.7 is just so last year.
    Seriously, MySQL 5 has a my.ini setting to behave more like version 4.x. In my.ini look for a sql-mode flag and change to sql-mode="MYSQL40", or disable strict mode.
    A search on the forums here for 1054 will probably bring up a lot of fixesas well, although 1.2.7 results may be in the archived section.

  7. #7
    Join Date
    Jun 2004
    Posts
    43
    Plugin Contributions
    0

    Default Re: 1054 Unknown column 'p.products_id' in 'on clause'

    I'm still running 1.2.7 and encountered this problem for the first time today.
    My host says they upgraded to MySQL 5.0 back in October.
    If that's the case, wouldn't the problem have occurred much sooner?

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

    Default Re: 1054 Unknown column 'p.products_id' in 'on clause'

    In theory yes. Perhaps it "has" been occurring in limited ways but nobody has reported it to you.

    However, if your hosting company did the upgrade but did *not* enable the MySQL5 "strict-trans-tables" setting (and another problematic one), then you may not be bitten by the sting of the stricter construction requirements.

    Either way, you should be planning an upgrade sooner than later...
    .

    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. 1054 Unknown column 'p.products_id' in 'on clause'
    By cathytsui in forum General Questions
    Replies: 0
    Last Post: 23 Jul 2009, 02:07 PM
  2. 1054 Unknown column 'p.products_id' in 'on clause'
    By jeffnord in forum Setting Up Categories, Products, Attributes
    Replies: 30
    Last Post: 30 Apr 2009, 05:22 PM
  3. 1054 Unknown column 'p.products_id' in 'on clause'
    By phylrust in forum General Questions
    Replies: 3
    Last Post: 5 Jan 2009, 08:36 PM
  4. 1054 Unknown column 'p.products_id' in 'on clause'
    By pepsishot in forum General Questions
    Replies: 14
    Last Post: 27 Aug 2007, 03:52 PM
  5. 1054 Unknown column 'p.products_id' in 'on clause'
    By JayCali in forum Installing on a Linux/Unix Server
    Replies: 15
    Last Post: 29 Apr 2007, 07:44 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