toby_uk Posted August 21, 2006 Share Posted August 21, 2006 Hi, I'm wondering if anyone can help with the following problem. My website was functioning correctly, however now there is a problem with the left hand category navigation menu. If you click on a category the following error message is displayed: 1054 - Unknown column 'p.products_id' in 'on clause' SELECT distinct p.products_id, pd.products_name, p.products_image, p.products_tax_class_id, pd.products_description, pd.products_short, s.status as specstat, s.specials_new_products_price, p.products_price from products p left join specials s on p.products_id = s.products_id, products_to_categories p2c, categories c left join products_description pd on p.products_id = pd.products_id and pd.language_id = '1' where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '2' and p.products_status = '1' and p.products_featured = '1' order by rand() DESC limit 2 [TEP STOP] You can view the error Here If anyone can offer any help/advice it would be greatly appreciated. :thumbsup: Link to comment Share on other sites More sharing options...
toby_uk Posted August 21, 2006 Author Share Posted August 21, 2006 If anyone has any idea what maybe causing the error please let me know! :D Link to comment Share on other sites More sharing options...
♥Monika in Germany Posted August 21, 2006 Share Posted August 21, 2006 try to move categories c right behind the from in your query. Looks like a server upgrade to me, where tables joined by left join need to be positioned next to each other in the query ... and the categories table seems to be in between such a join, breaking it. :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ... Link to comment Share on other sites More sharing options...
toby_uk Posted August 21, 2006 Author Share Posted August 21, 2006 Hi Monika, Thanks for your reply. I believe my host recently upgraded the server, so it may well be as you suggest, thanks for the help. :D Link to comment Share on other sites More sharing options...
♥Monika in Germany Posted August 23, 2006 Share Posted August 23, 2006 Hi, I'm wondering if anyone can help with the following problem. My website was functioning correctly, however now there is a problem with the left hand category navigation menu. If you click on a category the following error message is displayed: 1054 - Unknown column 'p.products_id' in 'on clause' SELECT distinct p.products_id, pd.products_name, p.products_image, p.products_tax_class_id, pd.products_description, pd.products_short, s.status as specstat, s.specials_new_products_price, p.products_price from products p left join specials s on p.products_id = s.products_id, products_to_categories p2c, categories c left join products_description pd on p.products_id = pd.products_id and pd.language_id = '1' where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '2' and p.products_status = '1' and p.products_featured = '1' order by rand() DESC limit 2 [TEP STOP] You can view the error Here If anyone can offer any help/advice it would be greatly appreciated. :thumbsup: Hi Toby, if you'd like me to correct the query, I'd need the full code (it's 4 queries) from index.php ... :-) Monika addicted to writing code ... can't get enough of databases either, LOL! my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum Interactive Media Award July 2007 ~ category E-Commerce my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.