Hello what I’m trying to do is retrieve values from tables but I’m having a problem with forming a correct SQL statement. This is what i have.
$qry_display = "SELECT a.section_id, b.section_id,b.student_id,c.*
FROM tbl_section AS a
LEFT OUTER JOIN tbl_er AS b On a.section_id = b.section_id
LEFT OUTER JOIN tbl_enroll AS c On b.student_id = c.student_id
WHERE b.student_id=c.student_id
AND a.bname='$branch'";
This is my database structure.
tbl_section:
section_id section_name sy adviser_id level
tbl_er:
student_id section_id
tbl_enroll
student_id fname lname
I’m having problems with forming the proper sql statement would appreciate any help on how to do it right. What i want is to show all students Under a given section.
In what table
bnamebelongs? changebnameintosectionname. Try this one,