iceblox Posted May 5, 2008 Share Posted May 5, 2008 Hi all, I have a table join that has been working but since i changed the where clause it no longer works. This is the query $query = "SELECT deals.MakeName, deals.ModelName, deals.ModelID, deals.ImageSmall, code.modelid FROM deals INNER JOIN code ON deals.ModelID = code.modelid WHERE code.modid = $modid GROUP BY deals.ModelName"; Since changing WHERE code.modid = $modid to WHERE code.modelid = $ModelID it doesnt work! I did some alterations which i thought would help me but in fact dont. I can get it to work like this $query = "SELECT deals.MakeName, deals.ModelName, deals.ModelID, deals.ImageSmall, code.modelid FROM deals INNER JOIN code ON deals.ModelID = code.modelid WHERE code.modid IN (SELECT modid FROM models WHERE affmodel = $ModelID) GROUP BY deals.ModelName"; But doesnt work how i want it too. Any suggestions? Link to comment https://forums.phpfreaks.com/topic/104270-solved-table-join/ Share on other sites More sharing options...
iceblox Posted May 6, 2008 Author Share Posted May 6, 2008 anyone got any ideas? Link to comment https://forums.phpfreaks.com/topic/104270-solved-table-join/#findComment-534205 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.