title: PHP while loop to make a table of images
body: <p>I am attempting to create a PHP script that will build a table of images from a database. I'm having a hard time figuring out how to properly nest my while loops to make a 6x(how ever many are in the db) table. I understand the concept but I am new to PHP and just can't wrap my head around doing it here.</p>
  
  <pre><code>&lt;?php 
  
  mysql_connect("localhost","root","");
  mysql_select_db("images");
  
  $res=mysql_query("SELECT * FROM table1");
  echo "&lt;table&gt;";
  while($row=mysql_fetch_array($res)){
  
  echo "&lt;tr&gt;";
  echo "&lt;td&gt;";?&gt;
  
  &lt;img src="&lt;?php echo $row["images1"]; ?&gt;" height="150" width="150"&gt;
  
  &lt;?php echo "&lt;/td&gt;";
  echo "&lt;/tr&gt;";}
  echo "&lt;/table&gt;";
  ?&gt;
  </code></pre>