title: How Can I Limit the Output from a PHP While Loop?
body: <p>I have a while loop running that is returning values from a MYSQL table.  It returns about 90 entries from the query.  My hope is to be able to break these 90 values up and display them in groupings of 5.  This may sound confusing so let me share some code samples to help clarify:</p>
  
  <pre><code>$con = mysql_connect("host", "username", "password") or die ("Unable to connect to server");
  mysql_select_db("database") or die ("Unable to select database");
  $sql = mysql_query("SELECT * FROM `table` WHERE column IS NOT NULL AND column &lt;&gt; ''");
  </code></pre>
  
  <p>Here I am pulling the values out that I need from the table...</p>
  
  <pre><code>while($row=mysql_fetch_array($sql))
  {
  $id=$row['id'];
  $column=$row['column'];
  
  echo $id . '&lt;br&gt;';
  echo $column . '&lt;br&gt;';
  
  }   
  </code></pre>
  
  <p>At this point, I have run the loop and get the display of all 90 entries.  How can I pull the values out and display them in smaller chunks?  If I use the looped values outside of the while loop, it just gives me the last value from the set.  Is there a simple way to use the unique <code>$id</code> value from the column to get a specific grouping within the loop?      </p>