Page 1 of 1

[SOLVED] First row not displaying

Posted: Tue Feb 22, 2005 2:11 pm
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

Posted: Tue Feb 22, 2005 2:13 pm
by feyd
lose the outer while loop.

Posted: Tue Feb 22, 2005 2:16 pm
by alix
haha, duh.. *slaps self* thanks feyd..