I have the following code which is intended to supply the family and given names of people who are in the users table but not in the quiz table. Can I even do this, and this throws an error anyway?
$query = mysql_query("SELECT quiz.userGroup AS q_userGroup, quiz.userDate, users.userGroup AS u_userGroup, DATE_FORMAT(quiz.addDate,'%b %e, %Y'), quiz.passState, users.family, users.given FROM quiz, users WHERE quiz.userIdRec = users.id AND users.userGroup IN('$g1', '$g2', '$g3', '$g4', '$g5') AND quiz.managerId='".$userid."' AND quiz.quizTitle ='".$_SESSION['squiz']."' AND (SELECT users.family AS u_family, users.given AS u_given FROM users LEFT JOIN quiz ON users.id = quiz.userIdRec WHERE quiz.userIdRec IS NULL AND users.userGroup IN('$g1', '$g2', '$g3', '$g4', '$g5')) AND quiz.userDate BETWEEN '".$start_raw."' AND '".$end_raw."' ORDER BY users.egroup, users.family, users.given, quiz.userDate");
The error lies in the section of code as follows "AND (SELECT users.family.....'$g2', '$g3', '$g4', '$g5'))"
Some help with the code would be much appreciated.