I have two tables I am pulling data from with one query:
SELECT studentid, firstname, lastname, classname FROM students, classes WHERE students.classid = classes.classid ORDER BY lastname ASC
-students- studentid firstname lastname classid
-classes- classid classname
The above query (with help from PHP) prints out a table of students first and last names, replacing the classid with classname.
However, when I delete a record from the 'classes' table, it causes any students with that particular classid to not show up, since nothing matches between the students and classes tables as far as classid.
So what is the best way to display all records in the 'students' table, while still replacing the classid with the classname, and also displaying those that have a deleted/unassociated classid?