Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2012

    Unanswered: Help ! sql querie retrieve data from table


    i want to retrieve data from one table but with condition that this data is in the same row as the other ,

    for example

    table student

    Student_ID Student_Name Teacher_id
    12 John 33
    11 Mike 45

    i've designed a web page which teacher can log in and use it , so if teacher with id 33 is log in i want him/her to see only the info of the student that she/he is teaching ! which is SID=12 and name is john from the table

    So i've a page that display all SID for each teacher log in
    how can i retrieve this data using seesion?

  2. #2
    Join Date
    Apr 2002
    Toronto, Canada
    SELECT student_id
         , student_name
      FROM student
     WHERE teacher_id = N
    substitute the teacher's id for N | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts