I have an odd problem with a do-while php loop that I have set up to build a drop down menu using information pulled from a database via mysql.
The drop-down menu code:
<?php while ($row2 = @mysql_fetch_assoc($result2)){ ?> <?php echo $row2['NumberDates']; ?> <?php } ?>The MYSQL pull:
“SELECT * FROM TransNumberID ORDER BY WeekID DESC”;
Related code to pull:
$result2 = mysql_query($query2);
if (!$result2) {
die('Invalid query: ’ . mysql_error());
} else {
$row2 = @mysql_fetch_assoc($result2);}
Here is the problem. I am pulling 9 records from a database. If I don’t specify a descending order on the pull, all nine dates appear in the dropdown. If I specify a descending order on the database, only 8 appear in the dropdown. The latest record in the database never appears in the dropdown when a descending order is specified, but will appear otherwise. Unfortunately, I need a descending order.
Does anyone know why this is happening?