Can anyone see what is wrong here? This is my first serious attempt at this.

$query1 = mysql_query("
SELECT topics.url_big, topics.url_small, topics.title, topics.".$egroup.", quiz.passState 
FROM topics 
ON (topics.managerId = quiz.".$managerId.") 
WHERE topics.".$egroup." = 1 
ORDER BY title ASC");

The line

ON (topics.managerId = quiz.".$managerId.")

should read

ON (topics.managerId = quiz.managerId)

By the way: you don't have to exclude PHP variables from double quotes. WHERE topics.$egroup = 1 is easier to read than WHERE topics.".$egroup." = 1