Forum Moderators: open
where can I put the psp table in this query? The INNER JOIN is necessary because there may be more than one category per pid.
Thanks for helping.
You are wanting to join the tables product_categories and products but your statement reads like you are joining the psp table.
SELECT
products.*, psp.price AS sprice
FROM
products,
psp INNER JOIN products_categories ON products_categories.pid=products.pid
AND products_categories.cid='270'
By changing the order your tables appear in the statement you should be able to fix it.... like this
SELECT
products.*, psp.price AS sprice
FROM
psp,
products INNER JOIN products_categories ON products_categories.pid=products.pid
AND products_categories.cid='270'
Notice how the products table is part of the inner join now?
The way you had it psp and product_category were the inner join but you were joining on products.pid because the products table isn't part of that join statement it doesn't see the products table.... hope this makes sense and that it works this way...
post back and let us know how it goes.