title: PHP Recordset and EOF
body: <p>I feel like I know this, but am getting frustrated that I can't remember exactly how to do this.</p>
  
  <p>In PHP, I need to repeat items of a record set in a unordered list. I can repeat items fine, but I don't want anything to show if the record set is empty. Right now, if there is no record, the code is still displaying a blank list item, when I just want nothing to appear.</p>
  
  <p>I have tried this:</p>
  
  <pre><code>&lt;?php do { ?&gt;
      &lt;li&gt;&lt;a href="#"&gt;Content Goes Here&lt;/a&gt;&lt;/li&gt;
  &lt;?php } while (!feof($recordsetName) &amp;&amp; $row_recordsetName = mysql_fetch_assoc($recordsetName)); ?&gt;
  </code></pre>
  
  <p>And I have tried doing it this way by putting the repeating element withing an if/else statement like this:</p>
  
  <pre><code>&lt;?php if (!feof($recordsetName)) {
      echo ""; }
  else do { ?&gt;
      &lt;li&gt;&lt;a href="#"&gt;Content Goes Here&lt;/a&gt;&lt;/li&gt;
  &lt;?php } while ($row_recordsetName = mysql_fetch_assoc($recordsetName));
  ; } ?&gt;
  </code></pre>
  
  <p>But that isn't working either. Any information would be helpful</p>