Jump to content

While Loop Is skiping the first row


max_w1

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.