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

Discussion in 'MySQL' started by tangwaichee, Dec 26, 2007.

  1. #1
    PDF Catalog(s) Generation

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

    select p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_model, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_description pd left join specials s on p.products_id = s.products_id, categories c, products_to_categories p2c where products_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id='80' order by pd.products_name, p.products_date_added DESC

    [TEP STOP]
     
    tangwaichee, Dec 26, 2007 IP
  2. n-james

    n-james Well-Known Member

    Messages:
    1,367
    Likes Received:
    70
    Best Answers:
    0
    Trophy Points:
    165
    #2
    I presume your referring to oscommerce?

    If you are, i kept getting that error and when i finally fixed it, it stopped the products working in the categories.
    I recommend you use Zen Cart, a script based off OSCommerce but 10x better
     
    n-james, Dec 26, 2007 IP
  3. Subikar

    Subikar Active Member

    Messages:
    241
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #3
    Actually you need to upgrade your oscommerce this will solve your problem.

    Thanks,
    Subikar
     
    Subikar, Dec 26, 2007 IP
  4. kendo1979

    kendo1979 Peon

    Messages:
    208
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    what column are there on your "products" table?
     
    kendo1979, Dec 27, 2007 IP
  5. Asif2BD

    Asif2BD Peon

    Messages:
    1,509
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I could solve this.
    Here is the solution.


    1. Open "index.php" in an html editor and do this:



    2. If you are getting 1054 - Unknown column 'p.products_id' in 'on clause' then replace p.products_id = s.products_id with p2c.products_id = s.products_id EXCEPT on the line specified in #1 above.


    Then open "advanced_search_results.php" in an html editor and do this:


    This problem should solved.
     
    Asif2BD, Dec 28, 2007 IP
  6. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    #6
    yes his host has upgraded his mysql from 4 to 5 thats where this problem come and it should be solved what asif2bd has suggested but before doing all this you should backup at least those files which you are going to change

    Regards

    Alex
     
    kmap, Jan 5, 2008 IP
  7. tangwaichee

    tangwaichee Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    mine is on the oscommence 2.2 admin section which i generate the catalog, it show me the error of 1054 - Unknown column 'p.products_id' in 'on clause'

    select p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_model, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_description pd left join specials s on p.products_id = s.products_id, categories c, products_to_categories p2c where products_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id='1' order by pd.products_name, p.products_date_added DESC
     
    tangwaichee, Jan 10, 2008 IP
  8. chrissyj

    chrissyj Peon

    Messages:
    56
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #8
    There is a typo in your SQL command. it should read:

    select p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_model, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_description pd left join specials s on pd.products_id = s.products_id, categories c, products_to_categories p2c where products_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id='80' order by pd.products_name, p.products_date_added DESC

    (Note the ONE CHARACTER difference!) You will need to find out which PHP module it is in, but that should be in your web browser address bar and you should be able to see it in your Apache error log.
     
    chrissyj, Jan 10, 2008 IP
  9. tangwaichee

    tangwaichee Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    can you help mew with it...pls???/
     
    tangwaichee, Jan 11, 2008 IP
  10. LittleJonSupportSite

    LittleJonSupportSite Peon

    Messages:
    386
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    0
    #10
    SSH into your machine and cd to your /oscommerce/install/dir

    Just do a

    
    grep -Ri yoursearchstring .
    
    Code (markup):
    Should be able to find the module and then vi and correct it.

    Who modified this code though? oSCommerce works out of the box....
     
    LittleJonSupportSite, Jan 11, 2008 IP
  11. tangwaichee

    tangwaichee Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    im dont use SSH.... and as im install the contribution of pdf catalog in oscommence of http://www.oscommerce.com/community/contributions,908/category,12/search,pdf+catalog. then im having error at the admin section when im (generate catalog)of it:-select p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_model, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_description pd left join specials s on p.products_id = s.products_id, categories c, products_to_categories p2c where products_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id='1' order by pd.products_name, p.products_date_added DESC
    Jan 5th 2008 7:32 am
     
    tangwaichee, Jan 11, 2008 IP
  12. chrissyj

    chrissyj Peon

    Messages:
    56
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #12
    How did you install OSC on the computer? Did you use FTP?
     
    chrissyj, Jan 14, 2008 IP
  13. jalvini

    jalvini Peon

    Messages:
    89
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #13
    thanks... i was getting this error all night and finally i have it fixed thanks to your input

    International SEO Company
     
    jalvini, Apr 27, 2008 IP
  14. Asif2BD

    Asif2BD Peon

    Messages:
    1,509
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Thankx that i could help u ppl.
     
    Asif2BD, Apr 27, 2008 IP