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

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.