PHP loop position
<p>Can someone help me on this. I'm made an image uploader and i want the image to make another tr if it reach to 5 pics so it will not overflow. Here is my code:</p>

<pre><code>$dbc = mysql_connect("localhost" , "root" , "") or die (mysql_error());
mysql_select_db('blog_data') or die (mysql_error());

$sql = "SELECT * FROM img_uploaded";
$result = mysql_query($sql);

while($rows=mysql_fetch_array($result))
{
  if ($rows)
  {
    echo "&lt;tr&gt;&lt;td&gt;&lt;img src='user_images/".$rows['img_name'] . "' width='100' height='100'&gt;&lt;/td&gt;&lt;/tr&gt;";
  }
  else
  {
    echo "&lt;td&gt;&lt;img src='user_images/".$rows['img_name'] . "' width='100' height='100'&gt;&lt;/td&gt;";
  }
}

mysql_close();
</code></pre>
