title: PHP echo $row['username'] not displaying the first username?
body: <p>I'm not really sure what the problem is here, I have a posts table that has a foreign key of userid and I want to pull their usernames from the users table based on that, it seems to pull them out fine but it won't display on the first post.
  My code is:</p>
  
  <pre><code>$query_therealuserid = 'SELECT users.username, users.userid, posts.userid, posts.created_at
  FROM users, posts
  WHERE users.userid = posts.userid
  ORDER BY posts.created_at';
  
  $therealuserid = mysql_query($query_therealuserid, $akaearthdb) or die(mysql_error());
  </code></pre>
  
  <p>and
      
      
      
      
      
      </p>
  
  <pre><code>&lt;?php do { ?&gt;
    &lt;div id= "post"&gt;
      &lt;?php if (stripos($row_rsjustpost['link'], ".png") !== false) {?&gt;
              &lt;img src="&lt;?php echo $row_rsjustpost['link']; ?&gt;" id="postImage" alt="Broken Link"&gt;
              &lt;?php }?&gt;
      &lt;?php if (stripos($row_rsjustpost['link'], ".gif") !== false) {?&gt;
              &lt;img src="&lt;?php echo $row_rsjustpost['link']; ?&gt;" id="postImage" alt="Broken Link"&gt;
              &lt;?php }?&gt;
      &lt;?php if (stripos($row_rsjustpost['link'], ".jpg") !== false) {?&gt;
              &lt;img src="&lt;?php echo $row_rsjustpost['link']; ?&gt;" id="postImage" alt="Broken Link"&gt;
              &lt;?php }?&gt;
      &lt;?php if (stripos($row_rsjustpost['link'], ".jpeg") !== false) {?&gt;
              &lt;img src="&lt;?php echo $row_rsjustpost['link']; ?&gt;" id="postImage" alt="Broken Link"&gt;
              &lt;?php }?&gt; 
  
      &lt;a href="&lt;?php echo $row_rsjustpost['link']; ?&gt;"&gt;&lt;?php echo $row_rsjustpost['title']; ?&gt;&lt;/a&gt;
      &lt;br/&gt;
      &lt;?php echo $row_rsjustpost['text']; ?&gt;
      &lt;/p&gt;
      &lt;br /&gt;
  
              &lt;?php 
              do {
              if ($whileLoopCounter0!=$whileLoopCounter1){break;}
          ?&gt;By: &lt;?php echo $row['username'];
          echo "&lt;br /&gt;";
              $whileLoopCounter1++;
  
              } while($row = mysql_fetch_array($therealuserid));
              ?&gt;
  
  
    &lt;/div&gt;
    &lt;?php $whileLoopCounter0++; ?&gt;
    &lt;?php } while ($row_rsjustpost = mysql_fetch_assoc($rsjustpost)); ?&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>when I pull up the page I get all the posts but the first one doesn't have a username and the usernames are all pushed down one post. The first post has a postid of 2, if I create a new post with a postid of 1 and a userid it shows up at the top without a username and the others usernames are moved up so that they are corect.</p>