[SOLVED] First row not displaying

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
alix
Forum Commoner
Posts: 42
Joined: Thu Nov 18, 2004 8:41 am

[SOLVED] First row not displaying

Post by alix »

What is causing the first row of information not to show up when i use this code to call information from my database.

Code: Select all

<?
echo "<table width="700" height="85"  cellpadding="0" border="1" cellspacing="0">";
echo "<tr><td> id </td><td> URL  </td><td> Hits</td>";
$get_links= mysql_query("SELECT * FROM links ORDER BY id ASC");

while($rows = mysql_fetch_row($get_links))
&#123;

while($myrows = mysql_fetch_assoc($get_links))
             &#123;

               //now print the results:
   $id= $myrows&#1111;'id'];
   $link= $myrows&#1111;'url'];
   $hits= $myrows&#1111;'count'];

//print results.

echo "<tr><td>". $id . " </td><td> " .$link. "  </td><td>". $hits . "</td>";

 &#125;
 &#125;;
 echo "</table>";
 ?>
Instead of displyaing rows 1, 2, 3, 4 its displaying 2, 3, 4
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

lose the outer while loop.
alix
Forum Commoner
Posts: 42
Joined: Thu Nov 18, 2004 8:41 am

Post by alix »

haha, duh.. *slaps self* thanks feyd..
Post Reply