Jump to content

Simple SQL query problem, can anyone help?


qwave

Recommended Posts

My web form contains a list of valid subjects that user can 'enroll' in.

The database contains a table of subjects, and also a table of subjects that users have enrolled in.

I need a query that returns a list of subjects that the user has not enrolled in.


Subject table: subject_id, name
Subject_Enrolled table: enrollment_id, subject_id, user_id


So I have to return all names in the subject table unless the particular user already has an entry for the
subject in the subject_enrolled table. What is the best way to get the query that returns the names of
all the subjects that the user has not yet enrolled in?


Thanks in advance!
Grem
Link to comment
https://forums.phpfreaks.com/topic/11122-simple-sql-query-problem-can-anyone-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.