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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.