MySQL Query
SELECT count( p.products_id ) AS total
FROM products_description AS pd, products AS p
LEFT JOIN manufacturers AS m ON p.manufacturers_id = m.manufacturers_id, products_to_categories p2c
LEFT JOIN specials AS s ON p.products_id = s.products_id
WHERE p.products_status = '1'
AND p.products_id = p2c.products_id
AND pd.products_id = p2c.products_id
AND pd.language_id = '1'
AND p2c.categories_id = '176'
markup#1054 - Unknown column 'p.products_id' in 'on clause'
Its mySQL v5. I have this exact same setup on a live up and running website and it works fine. however i'm setting up a development environment on a new server, and i've had to upgrade from MySQL 4 to MySQL 5.. and now i get this error.
the table products deffinatly exsists.. products_id deffinatly exsists. yet i get this error.. im sure my JOIN's are fine.
suggestions?
p.products_id deffinatley exsists.
all the tables and colums are deffiantly there, becuse im using the exact same setup on another server using mySQL v4.
i figure its a v4 / v5 issue, because we all know v5 is alot more sensitive.
i just cant figure out which bit if wrong… :whoa:
and yes, i thought maybe it was a connection issue, so now im using phpmyadmin and it still gives same error.
Happy searching ;x
Thanks for the replies, i've now fixed it.
solution:
SELECT count( p.products_id ) AS total
FROM (products_description AS pd, products AS p, products_to_categories p2c)
LEFT JOIN manufacturers AS m ON p.manufacturers_id = m.manufacturers_id
LEFT JOIN specials AS s ON p.products_id = s.products_id
WHERE p.products_status = '1'
AND p.products_id = p2c.products_id
AND pd.products_id = p2c.products_id
AND pd.language_id = '1'
AND p2c.categories_id = '176'
dam MySQL v5!