Stooney Posted June 4, 2009 Share Posted June 4, 2009 Maybe it's just cause I'm tired, but I'm getting double results from this query and can't figure it out. SELECT r.report_id, r.report_name FROM apd_reports as r, apd_rpd as p WHERE p.discipline_id=1 apd_reports is two columns (report_id, report_name) apd_rpd is three columns (apd_id, discipline_id, report_id) All it needs to do is grab all the report ids/names of the reports matched with the given discipline id. This is working, but it's giving me the results twice Link to comment https://forums.phpfreaks.com/topic/160879-solved-double-results/ Share on other sites More sharing options...
Ken2k7 Posted June 4, 2009 Share Posted June 4, 2009 What's the relationship between apd_reports and apd_rpd? There has to be a column like r.something = p.something right? Link to comment https://forums.phpfreaks.com/topic/160879-solved-double-results/#findComment-849022 Share on other sites More sharing options...
Stooney Posted June 4, 2009 Author Share Posted June 4, 2009 TY Ken2k7. Your question answered my question. I knew I was just missing something little. And to answer your question the relationship is report_id, which is what I had forgot about after I went into a coma mid query. Link to comment https://forums.phpfreaks.com/topic/160879-solved-double-results/#findComment-849044 Share on other sites More sharing options...
Ken2k7 Posted June 4, 2009 Share Posted June 4, 2009 This is solved? If so, please mark it. Link to comment https://forums.phpfreaks.com/topic/160879-solved-double-results/#findComment-849047 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.