How to join this table?
- by pamella
ads table
img90.imageshack.us/img90/6295/adsvo.png
phones table
img194.imageshack.us/img194/3713/phones.png
cars table
img35.imageshack.us/img35/1035/carsm.png
i have 3 tables ads,cars and phones.
i want to join tables is based on category in ads table.
and i tried this query but no luck,any helps?
SELECT *
FROM `ads`
JOIN `ads.category` ON `ads.id` = `ads.category.id`
** i cant add comment any of your post,but i want it to be automatic based on category in ads table.
for example :-
if in table have phones category,i will automatic join phones table then
SELECT *
FROM `ads`
JOIN `phone` ON `ads.id` = `phone.id`
if in table have cars category,i will automatic join cars table
SELECT *
FROM `ads`
JOIN `cars` ON `ads.id` = `cars.id`