Results 1 to 10 of 14

Hybrid View

  1. #1
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default 1054 Unknown column error after site went live

    So if you go to these links you get the errors in the queries as shown:
    http://www.hairisle.com/products_new
    1054 Unknown column 'p.master_categories_id' in 'on clause'
    in:
    [select count(p.products_id) as total FROM zen_products p LEFT JOIN zen_manufacturers m ON (p.manufacturers_id = m.manufacturers_id), zen_products_description pd LEFT JOIN zen_hide_categories h ON (p.master_categories_id = h.categories_id) WHERE (h.visibility_status < 2 OR h.visibility_status IS NULL) AND p.products_status = 1 AND p.products_id = pd.products_id AND pd.language_id = 1 ]
    http://www.hairisle.com/products_all
    1054 Unknown column 'p.master_categories_id' in 'on clause'
    in:
    [select count(p.products_id) as total FROM zen_products p LEFT JOIN zen_manufacturers m ON (p.manufacturers_id = m.manufacturers_id), zen_products_description pd LEFT JOIN zen_hide_categories h ON (p.master_categories_id = h.categories_id) WHERE (h.visibility_status < 2 OR h.visibility_status IS NULL) AND p.products_status = 1 AND p.products_id = pd.products_id AND pd.language_id = 1 ]
    This did not ocurr on the dev site as you can see:
    http://clients.overthehillweb.com/hairisle/products_new
    http://clients.overthehillweb.com/hairisle/products_all


    I've been doing a LOT of searching of this forum and Googling, and my research indicates that this might be an issue with the on clause of the left join.. This post was very helpful in nundging me inthe right direction. It reads in part:
    http://www.zen-cart.com/forum/showpo...47&postcount=6
    The real culprit is Mysql data base queries. Once your host upgrade sql database to 5.x, you need to fix your sql queries...
    So I took a look at both dev and the live site and yes indeed they are on different versions of mySQL. (thought my server was running 5.x.. it's not... I'll deal with that later this week)

    DB Versions:
    hairisle dot com - Database: MySQL 5.0.81-community-log
    clients dot overthehillweb dot com/hairisle - Database: MySQL 4.1.22-max-log

    So I think I have a grasp on WHAT the issue is, and if I can get some assistance to what the corrected syntax for these queries should be, I should be good to go in correcting the queries for these pages..

    I am hoping a SQL guru can pop in to help.. YES I read other threads on this error.. Unfortunately the queries are different, and I can't make the leap to figure out how to correct the syntax of this query based on some of the other threads.. Hope someone will take pity on me and help..
    Last edited by DivaVocals; 21 Oct 2009 at 09:31 PM.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: 1054 Unknown column error after site went live

    What version of Zen Cart?
    What addons are installed?
    What customizations have been made to what parts of the code?
    .

    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
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: 1054 Unknown column error after site went live

    Quote Originally Posted by DrByte View Post
    What version of Zen Cart?
    What addons are installed?
    What customizations have been made to what parts of the code?
    Just the man I was hoping to hear from..

    Version 1.3.8a
    Tons of add-ons but the All Products and and New Products pages includes modified code from two add ons (Single Listing Template and Hidden Categories) The query that causing this issue is from the Hidden Categories add-on.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: 1054 Unknown column error after site went live

    Okay, so it seems clear that your Hidden Categories addon is NOT compatible with MySQL 5.
    .

    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
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: 1054 Unknown column error after site went live

    My hunch is that the 2nd LEFT JOIN is pointless, and actually a waste of CPU power, in addition to its incompatibility with MySQL 5.

    Reworking the query this way seems to be more efficient:
    Code:
    select count(p.products_id) as total 
      FROM products p LEFT JOIN manufacturers m ON (p.manufacturers_id = m.manufacturers_id), 
           products_description pd, 
           hide_categories h 
     WHERE p.master_categories_id = h.categories_id AND (h.visibility_status < 2 OR h.visibility_status IS NULL) 
       AND p.products_status = 1 AND p.products_id = pd.products_id AND pd.language_id = 1 ;
    Hopefully that gives you a starting point of how to rewrite the query in the addon.
    .

    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
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: 1054 Unknown column error after site went live

    Thanks sooooo very much... When I get home tonight I'm gonna play around with this.. I know how to write/edit simpler SQL, but joins have ALWAYS confused me.. So I REALLY thank you for the help!!!
    Quote Originally Posted by DrByte View Post
    My hunch is that the 2nd LEFT JOIN is pointless, and actually a waste of CPU power, in addition to its incompatibility with MySQL 5.

    Reworking the query this way seems to be more efficient:
    Code:
    select count(p.products_id) as total 
      FROM products p LEFT JOIN manufacturers m ON (p.manufacturers_id = m.manufacturers_id), 
           products_description pd, 
           hide_categories h 
     WHERE p.master_categories_id = h.categories_id AND (h.visibility_status < 2 OR h.visibility_status IS NULL) 
       AND p.products_status = 1 AND p.products_id = pd.products_id AND pd.language_id = 1 ;
    Hopefully that gives you a starting point of how to rewrite the query in the addon.

 

 

Similar Threads

  1. 1054 Unknown column error
    By godin5150 in forum General Questions
    Replies: 3
    Last Post: 30 Sep 2008, 06:03 AM
  2. 1054 Unknown column ERROR
    By TripleMoons in forum Upgrading from 1.3.x to 1.3.9
    Replies: 4
    Last Post: 25 Apr 2008, 09:43 PM

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