Hello currently working with this code
$qry_display = "
SELECT
student_id,
fname,
sex,
lname,
mname,
level,
photo,
birth_date,
birth_place,
address,
father,
father_occupation,
father_phone,
father_company,
father_degree,
mother,
mother_occupation,
mother_phone,
mother_company,
mother_degree,
adviser_id
from
tbl_enroll
where
student_id='$id'
AND level='$lvl'
";
$sql_display = mysql_query($qry_display) or die (mysql_error());
The above code fetches most data from tbl_enroll. Now I want to acquire some data on tbl_er. tbl_enroll and tbl_er are connected with the primary key of student_id , also connect once to tbl_section. tbl_er and tbl_section are connected with the foreign key of section_id.
So far I was thinking of doing multiple sql queries and use one mysql_query trigger but it wont work because the trigger wont work with three sql queries.
student_idis the pk in all 3 tables, you can use join statements (assuming, of course, that the data you want fromtable_errelates to data from those students you've already got from the enroll table). 2. I hope you're protecting against SQL injection...