I am putting content from a query on two places on my web page. It appears that I can't use this:
<?php
while ($row = mysql_fetch_array($activeTitles, MYSQL_ASSOC)) {
if ($row['rank_number'] == 0) {
print "<a href=\"${mySESself}main.articleDetail/articleID/".$row['currentID']."\">";
print $row['title']."</a><br>\n";
} // End if EQ 0
}
print "</P>";
print "<hr>";
print "<div class=\"Head2\">Yudansha Papers</div><P>";
while ($row = mysql_fetch_array($activeTitles, MYSQL_ASSOC)) {
if ($row['rank_number'] != 0) {
print "<a href=\"${mySESself}main.articleDetail/articleID/".$row['currentID']."\">";
print $row['rank']." essay: ".$row['F_Name']." ".$row['L_Name']." - <em>".$row['title']."</em></a><br>\n";
} // End if not equal
}
I can see the output for the first loop, but not the second. I first thought that I needed to reset($row), but that didn't fix the problem.
Perhaps I cannot use a while loop but need a foreach()? Using the while loop seems the standard way shown in my books, but how can I solve this?
Thanks in advance.