Strange one, driving me crazy. I just cannot see why.
I have a query that pulls club officers names and email addresses from a table. This is to generate a "Contact" page for our veterans organization. There are 6 records returned, but only the last 5 are displayed when I printf them in a while loop. I do this all over my sites and have never seen this before.
The $num_rows even returns 6, but the loop only displays the last 5.
<?php
$query = "SELECT nickname, email, role FROM user_table where role NOT IN ('Member', 'Initiate', 'Deceased') order by role desc";
$results = mysql_query($query) or die("Query failed");
$list = mysql_fetch_row($results);
$num_rows = mysql_num_rows($results);
?>
<table border=0>
<tr>
<td><font color=white size=5><u>Officer</u></td>
<td></td>
<td><font color=white size=5><u>Contact Info</u></td>
</tr>
<?php
while($list = mysql_fetch_row($results)) {
printf("<tr><td><font color=white size=5><b>%s</b></font></td><td></td><td><font size=5><a href=\"mailto:%s\">%s</a></font></td></tr>",
$list[2], $list[1], $list[0]);
}
?>
</table>
<font color=white><?php echo $num_rows;?></font>
Any ideas? Thanks!