llcooljayce Posted July 21, 2006 Share Posted July 21, 2006 Hey guys, here's my code:<html> <head> <title>Completed RSVPs</title> </head> <body> <center> <table border="1"> <tr> <td align="center"><b>Count</b></td> <td align="center"><b>First Name</b></td> <td align="center"><b>Last Name</b></td> <td align="center"><b>Attending Ceremony</b></td> <td align="center"><b>Adults</b></td> <td align="center"><b>Kids</b></td> <td align="center"><b>Attending Reception</b></td> <td align="center"><b>Adults</b></td> <td align="center"><b>Kids</b></td> </tr><?require 'inc/db_connect.php';$sql = 'select * from verify where complete=1 order by lname, fname';$result = mysql_query($sql);$row = mysql_fetch_array($result, MYSQL_BOTH);$count = 0;while ($row = mysql_fetch_array($result)) { $count++; $fname = $row['fname']; $lname = $row['lname']; $ceremony = $row['attending_ceremony']; $adult_ceremony = $row['adult_ceremony']; $child_ceremony = $row['child_ceremony']; $reception = $row['attending_reception']; $adult_reception = $row['adult_reception']; $child_reception = $row['child_reception']; echo '<tr>'; echo '<td align="center">'.$count.'</td>'; echo '<td align="center">'.$fname.'</td>'; echo '<td align="center">'.$lname.'</td>'; if($ceremony=="0") echo '<td align="center">No</td>'; else echo '<td align="center">Yes</td>'; echo '<td align="center">'.$adult_ceremony.'</td>'; echo '<td align="center">'.$child_ceremony.'</td>'; if($reception=="0") echo '<td align="center">No</td>'; else echo '<td align="center">Yes</td>'; echo '<td align="center">'.$adult_reception.'</td>'; echo '<td align="center">'.$child_reception.'</td>'; echo '</tr>';}?> </table> </center> </body></html>I don't know why but the 'while ($row = mysql_fetch_array($result)) { ' clause doesn't seem to return the first row of the results ... any ideas why? Link to comment https://forums.phpfreaks.com/topic/15271-mysql-not-returning-the-first-row/ Share on other sites More sharing options...
fenway Posted July 21, 2006 Share Posted July 21, 2006 Of course it doesn't... you've issued a previous call to mysql_fetch_array() a few lines earlier, for no apparent reason, so the row iterator has already been incremented by 1. Link to comment https://forums.phpfreaks.com/topic/15271-mysql-not-returning-the-first-row/#findComment-61817 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.