Jump to content

querying result array


dollythesheep

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.