I'm doing a simple query and for some reason my first row is being omitted. how come? $queryTownA = "SELECT * FROM towns WHERE letter='A' ORDER BY tname ASC"; $resultTownA = mysql_query($queryTownA) or die(mysql_error()); $rowTownA = mysql_fetch_array($resultTownA); Then Below <ul> <?php while($rowA = mysql_fetch_array($resultTownA)){ ?> <li><a href="town.php?tid=<?php echo $rowA['tid']; ?>"><?php echo $rowA['tname']; ?></a></li> <?php }; ?> </ul> My results are working but the first row is not there.. MISSING TOWN HERE Acton Acushnet Adams any ideas? thanks!!!
OK - i just solved my own problem by removing this: $rowTownA = mysql_fetch_array($resultTownA);from my query string. My new question is why would this omitt the first row?
Basically you are fetching the array once and then looping through it. The first time you fetch it, you are removing the first row. Remove this: $rowTownA = mysql_fetch_array($resultTownA); From the top section.