dannyone Posted March 23, 2009 Share Posted March 23, 2009 hello everyone i have a rather complex query that i am trying to make but i just can't figure out how im going to do it, here is my table structure Marker_Free table Marker_ID, timeslot, day, status Marker_Rooms table Marker_ID, Room_ID Rooms_Free table Room_ID, timeslot, day, status now what i need to do is compare all the data in these tables and show them in a html table. i have attempted to do the query and i can get it to display the room availability for tht user, but i also want it to show that markers availability on the same table. i have two seperate querys that do these, but i need to make them into 1 so i can show all the results. can some1 have a look and try and help me combine the queries so that it works. any help would be greatly appreciated! this code displays Room availability for the user "SELECT Mf.Marker_ID, Mf.timeslot, Mf.day, Mf.Status, Rf.Room_ID, Rf.timeslot, Rf.day, Rf.status, Mr.Marker_ID, Mr.Room_ID FROM Marker_Free AS Mf INNER JOIN Marker_Rooms AS Mr ON (Mf.Marker_ID = Mr.Marker_ID) INNER JOIN Rooms_Free AS Rf ON (Mr.Room_ID = Rf.Room_ID) WHERE Mf.Marker_ID = '" .$_SESSION['login'] . "'"); this code displays that Markers availability "SELECT Marker_ID, timeslot, day, Status FROM Marker_Free WHERE Marker_ID = '" .$_SESSION['login'] . "'"); Thanks in advance! Link to comment https://forums.phpfreaks.com/topic/150784-inner-join-help/ Share on other sites More sharing options...
fenway Posted March 27, 2009 Share Posted March 27, 2009 Isn't the second query covered by the first one? Link to comment https://forums.phpfreaks.com/topic/150784-inner-join-help/#findComment-795291 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.