The code below includes two almost identical SELECT queries. The query that is commented out always returns the array in duplicate rows. The only difference is that the commented out code has had "ORDER BY topics ASC" removed. This is a problem because I cannot sort the array. Has anyone an explanation and a solution?
$query = mysql_query("SELECT topics.url_big, topics.url_small, topics.title, topics.$egroup, quiz.passState, quiz.userDate FROM topics INNER JOIN quiz ON (topics.managerId = quiz.managerId) WHERE topics.$egroup = 1 ");
//$query = mysql_query("SELECT topics.url_big, topics.url_small, topics.title, topics.$egroup, quiz.passState, quiz.userDate FROM topics INNER JOIN quiz ON (topics.managerId = quiz.managerId) WHERE topics.$egroup = 1 ORDER BY title ASC");
while ($row1 = mysql_fetch_array($query))
{
echo "<a href='../../wood/wood_tool_images/{$row1['url_big']}' target='_blank'><img src='../../wood/wood_tool_images/{$row1['url_small']}' /><br />\n";
echo "{$row1['title']} <br />\n";
echo "<a href='../equipment/{$row1['title']} Safety Quiz/{$row1['title']} Safety Quiz.php'>Take This Quiz</a><br />\n";
echo "{$row1['userDate']} <br />\n";
}