Hi Guys,
I upgraded my web server and have since had to update to mysql 5. As I'm sure much of you have discovered you'll get some '1054 Unknown column 'p.products_id' in 'on clause' errors. I have fixed all of the areas where the problems have popped up, except for one, which is a query from my own highly modified version of featured_products.php I grew enough talent to create the query at the time, but apparently my talent has left. I have beat myself up to try to figure out what the correct new syntax for this query is, but I'm missing something. Can someone take a look and nudge me in the right direction? Thanks.
Code:select distinct p.products_id, p.products_quantity, p.products_image, m.manufacturers_id, m.manufacturers_image, m.manufacturers_name, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price, p.products_price, d.short_desc from " . TABLE_PRODUCTS . " as p left join " . TABLE_SPECIALS . " as s on (p.products_id = s.products_id), " . TABLE_PRODUCTS_TO_CATEGORIES . " as p2c, " . TABLE_CATEGORIES . " as c left join " . TABLE_FEATURED . " f on (p.products_id = f.products_id) left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id) left join " . TABLE_PRODUCTS_DESCRIPTION . " d on (p.products_id = d.products_id) where p.products_id = p2c.products_id and d.products_id = p2c.products_id and f.products_id = p2c.products_id and s.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . $featured_products_category_id . "' and p.products_status = '1' and f.status = '1' order by rand() DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS





LinkBack URL
About LinkBacks







Bookmarks