dollythesheep Posted March 30, 2008 Share Posted March 30, 2008 I'm trying to query so that the answers of my first query becomes part of my second query and the answers to the second query becomes part of the third query...but it's not returning anything..any ideas? $qry = "SELECT * FROM detentiondates"; $result = mysql_query($qry); $result_array = mysql_fetch_assoc($result); $qry2 = "SELECT detentiondate FROM detention WHERE detentiondate='$result_array[result]' AND pupilno='$_SESSION[pupilno]'"; $result2 = mysql_query($qry2); $result_array2 = mysql_fetch_assoc($result2); $query3 = mysql_query("SELECT detentiondates.detentiondate FROM detentiondates, academicyear WHERE detentiondates.detentiondate != '$_SESSION[detentiondate]' AND detentiondates.detentiondate <= academicyear.enddate AND detentiondates.detentiondate >= academicyear.startdate AND detentiondates.detentiondate != '$result_array2[result2]' "); $result3 = mysql_query($query3); Link to comment https://forums.phpfreaks.com/topic/98604-querying-result-array/ Share on other sites More sharing options...
fenway Posted March 30, 2008 Share Posted March 30, 2008 Huh? Link to comment https://forums.phpfreaks.com/topic/98604-querying-result-array/#findComment-504665 Share on other sites More sharing options...
mwasif Posted March 30, 2008 Share Posted March 30, 2008 Look at Subquery. Link to comment https://forums.phpfreaks.com/topic/98604-querying-result-array/#findComment-504749 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.