I am trying to select all rows from my quiz_assign table which have a classid that corresponds to a teacherid in my class table. I only need the rows from the quiz_assign table.
The query I built works if there is only one row selected from the class table, if a teacherid corresponds with multiple classes my query does not work.
$teachersclassesquery = pg_query($db_handle, "SELECT * FROM quiz_assign WHERE classid = (SELECT classid FROM class WHERE teacherid = '$teacherid')");
I cannot find a way to do this without altering the quiz_assign table to include teacherid. Any help is greatly appreciated.
Use
ininstead of=