max_w1 Posted February 19, 2011 Share Posted February 19, 2011 hi i want to know how to not skip the first mysql row by using while loop here is my code <?php $mid = $_SESSION['loggedin']; //echo $mid; $datacat = mysql_query ("SELECT * FROM `leads` WHERE `id` =1") or die(mysql_error()); $mydatacat = mysql_fetch_assoc($datacat); //loop start while($row = mysql_fetch_array($datacat, MYSQL_ASSOC)) { ?> <li class="contact clearfix"> <div class="avatar"><img src="./images/user_32.png" /></div> <a class="more" href="./lead_details.php?uid=<?php echo $row['uid'];?>">»</a> <span class="timestamp"><?php echo $row['country'];?></span> <a href="#" class="name"><?php echo $row['company_name'];?></a> <div class="entry-meta"> <?php echo $row['officials_name']."(".$row['job_title'].")"; ?> </div> </li> <?php // loop end } ?> example: the mysql table looks like this id uid row 01 1 first row 02 1 second row 03 2 third row but by using the while loop i can not see the first row. Link to comment https://forums.phpfreaks.com/topic/228225-while-loop-is-skiping-the-first-row/ Share on other sites More sharing options...
litebearer Posted February 19, 2011 Share Posted February 19, 2011 remove this line or rest pointer $mydatacat = mysql_fetch_assoc($datacat); Link to comment https://forums.phpfreaks.com/topic/228225-while-loop-is-skiping-the-first-row/#findComment-1176903 Share on other sites More sharing options...
max_w1 Posted February 19, 2011 Author Share Posted February 19, 2011 yea, it was the unnecessary line that was causing problem. thanks Link to comment https://forums.phpfreaks.com/topic/228225-while-loop-is-skiping-the-first-row/#findComment-1176905 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.