Jump to content

mySQL SELECT Help Please.


mattevans

Recommended Posts

Hi All.

 

I have a little database of students Im currently working with. When a certain user logs in, they are shown certain details depending on what school they belong to.

 

Im trying to SELECT all information from tbl_students WHERE the schoolID equals the school they belong to, but also the roomID (the room which they have selected).

 

This way it will show me the students in a certain room, in a certain school. Im currently using the below code which doesnt work properly...

 

 

$query = 'SELECT * FROM tbl_students WHERE schoolID ='.$_SESSION['schoolID'].' AND roomID ='.$roomID; 

 

 

Could someone please help me with this. It would be much appreciated.

I have spent hours trying to work this thing out!   :-X

 

Thanks in Advance.

 

Matt Evans  ;D

Link to comment
https://forums.phpfreaks.com/topic/50850-mysql-select-help-please/
Share on other sites

How does it "not work properly?"  What results are you getting, if any, and what results did you expect?  What's your table definition?  Have you checked for errors, and, if so, what were they?

 

You haven't supplied enough information for a diagnosis.  Prima facie, the query is syntactically correct.

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.