I think I'm making it too hard...
All I need to do is count the number of users with a CDID = 'whatever' and not display the class in my dynamic dropdown...
On that same page, in a different query, I compare NOW() < `CDLastTime`
SELECT * FROM ClassDetails WHERE NOW() < `CDLastTime` ORDER BY ClassDetails.CDDate ASC
The idea behind that is, if the class start time is INSIDE 48 hours (or whatever the 'CDLastTime' is) it doesn't show... So maybe I use the same strategy and not display the class once the users total >= `CDMaximum`...
The problem(?) is, the 'CDMaximum' row is in the 'ClassDetails' table and the 'CDID' row I'm counting is in the 'rtnUser' table... Does it make sense to do something like this?
SELECT * FROM rtnUser LEFT JOIN ClassDetails on rtnUser.CDID = ClassDetails.CDID COUNT(rtnUID) AS total FROM rtnUser GROUP BY CDID
In which case, do I need to LEFT JOIN the 'ClassDetails' and 'rtnUser' tables then count the CDID??? Or can I because the 'ClassDetails' table has a different CDID count???
Your thoughts?