ok, I've got a query built dynamically based on how a user fills out a web form. In this case, the query ends up being:
SELECT FirstName, LastName FROM registrations WHERE VisitDate like 'February%' order by LastName, FirstName
a bunch of stuff happens that is unrelated to this discussion. Then the script exectues the following code:
echo " <table width=\"500\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"margin-left: 15px; \">\n";
do {
printf (" <tr>\n");
printf (" <td width=\"500\">%s, %s</td>\n", $record["LastName"], $record["FirstName"]);
printf (" </tr>\n");
printf (" <tr>\n");
printf (" <td width=\"500\">%s<br>%s, %s %s<br>%s<br><br></td>\n", $record["Street"], $record["City"], $record["State"], $record["Zip"], $record["Country"]);
printf (" </tr>\n");
}
while ($record = mysql_fetch_array($result));
echo " </table>\n";
Now, here's the problem. The first record displayed is always displayed twice. If I change the order by clause in the query to change the order the records are displayed, then which ever record is displayed first based on the order by clause gets displayed twice. Any idea why? I've been looking at this code for a few days now, so my eyes are pretty much shot (i.e. it's probably something simple that I'm missing).
Thanks in advance.