dlf1987 Posted August 6, 2008 Share Posted August 6, 2008 I want to use the same query 2x on the same page.. I tried this... <?php do { echo $row_rsTracking['track_id']; } while ($row_rsTracking = mysql_fetch_assoc($rsTracking)); mysql_data_seek($rsTracking, 0); //Reset ?> RESULTS: Line1 Line2 <?php do { echo $row_rsTracking['track_id']; } while ($row_rsTracking = mysql_fetch_assoc($rsTracking)); ?> RESULTS: [blank line] Line1 Line2 Why is there an extra line showing up for the 2nd do while? Quote Link to comment Share on other sites More sharing options...
lemmin Posted August 6, 2008 Share Posted August 6, 2008 Because you are using a DO WHILE which evaluates the condition after executing the code. $row_rsTracking probably doesn't exist at the first loop, but maybe you have error reporting off. At the second loop, $row_rsTracking was set to null from the previous conditional operation. It should work if you use a regular while loop instead. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.