Im currently writing a prototype online regristration system for a school. I have most everything completed but one last major query.
Its for the add schedule for the student. What I need it to do is check the existing students records and pull a list of all classes the student has and is currently taking.
This information is stored in a table called transscript. The courses are stored as unique course id numbers.
Once I get this very large list of courses I want to pull all courses offered from the course database that do not match any of the courses already taken.
How should I go about writing this massive and very random select statement?
I though about this
select courses student has taken store in $takenArray;
foreach $takenArray as $badClass{
$condition.= "AND classIndex != ".$badClass;
}
$sql = "select * from courses where classIndex != $badclass".$condition;
mysql_query($sql);
would this be the most efficient way to do this?
Thanks,
Jesse