Okay, so these are your two queries:
SELECT url_big, url_small, title, comment
FROM topics
WHERE managerId = $managerId
AND $egroup = 1
ORDER BY title;
SELECT DISTINCT quizTitle, userId, passState, userScore, totalScore, userDate
FROM quiz
WHERE managerId = $managerId
AND userId = $userId
ORDER BY quizTitle, userDate;
Laserlight will kill me for suggesting this, but you could try a natural join, since you said the tables only have one column name in common:
SELECT DISTINCT url_big, url_small, title, comment, quizTitle, userId, passState, userScore, totalScore, userDate
FROM topics
NATURAL JOIN quiz
WHERE managerId = [some value]
//add additional WHERE clauses if needed
ORDER BY title;
If you prefer to avoid using natural joins, then modify the above query to:
SELECT DISTINCT url_big, url_small, title, comment, quizTitle, userId, passState, userScore, totalScore, userDate
FROM topics
JOIN quiz ON topics.managerId = quiz.managerId
WHERE managerId = [some value]
//add additional WHERE clauses if needed
ORDER BY title;
To be honest I am confused about your explanation regarding the $egroup variable. Could you perhaps explain exactly what you're trying to accomplish with the query(ies)?