title: Creating a dynamic table with PHP
body: <p>I'm trying to make a dynamic table with PHP. I have a page which displays all the pictures from a database. 
  I need the table to be of 5 columns only. If more than 5 pictures are returned, it should create a new row and the displaying of the rest of the pics would continue.</p>
  
  <p>Can anyone please help? </p>
  
  <p>Codes go here:
  Code in the main page:-</p>
  
  <pre><code>    &lt;table&gt;
      &lt;?php
          $all_pics_rs=get_all_pics();
          while($pic_info=mysql_fetch_array($all_pics_rs)){
          echo "&lt;td&gt;&lt;img src='".$pic_info['picture']."' height='300px' width='400px' /&gt;&lt;/td&gt;";
              } 
  ?&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>The get_all_pics() function:</p>
  
  <pre><code>$all_pics_q="SELECT * FROM pics";
          $all_pics_rs=mysql_query($all_pics_q,$connection1);
          if(!$all_pics_rs){
              die("Database query failed: ".mysql_error());
          }
          return $all_pics_rs;
  </code></pre>
  
  <p>This code is creating a single row. I can't think of how I can get multiple rows ... !!</p>