glennn.php Posted May 16, 2010 Share Posted May 16, 2010 ok, I have two tables: Petitions +------------------+-----------------+ | petition | petition_auth +------------------+-----------------+ | 1 | 1 | 2 | 2 | 3 | 2 +------------------+-----------------+ Signatures +------------------+-----------------+ | petition | petition_sig +------------------+-----------------+ | 1 | glenn | 1 | bob | 2 | alice | 3 | jane +------------------+-----------------+ i have lost my mind and cannot figure out how to get JUST the Signatures for ALL of the petitions belonging to Author 2. i'm not very good with JOINs, but i'm not even sure that that's necessary. could someone lend a hand? thanks GN Link to comment https://forums.phpfreaks.com/topic/201949-ive-lost-my-mind-help-with-simple-join-query/ Share on other sites More sharing options...
jskywalker Posted May 16, 2010 Share Posted May 16, 2010 SELECT s.petition_sig FROM petition p INNER JOIN Signatures s ON p.petition = s.petition WHERE p.petition_auth = 2 Link to comment https://forums.phpfreaks.com/topic/201949-ive-lost-my-mind-help-with-simple-join-query/#findComment-1059131 Share on other sites More sharing options...
glennn.php Posted May 16, 2010 Author Share Posted May 16, 2010 is that SELECT s.petition_sig FROM Petitions p INNER JOIN Signatures s ON p.petition = s.petition WHERE p.petition_auth = 2 ? Link to comment https://forums.phpfreaks.com/topic/201949-ive-lost-my-mind-help-with-simple-join-query/#findComment-1059171 Share on other sites More sharing options...
glennn.php Posted May 16, 2010 Author Share Posted May 16, 2010 that worked thanks Link to comment https://forums.phpfreaks.com/topic/201949-ive-lost-my-mind-help-with-simple-join-query/#findComment-1059178 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.