showing 3 Images in a table row from a list of 10 images or more - PHP
<p>in a database there are some images [of unknown number], i need to show them 3 in a row
here is my code, but it does not work [in some row it shows 2 or 4 photos] :(</p>

<pre><code>&lt;?php
$temp=0;
$stmt = mysqli_prepare($con,"select PicName from Pic_Details");
mysqli_stmt_execute($stmt);
mysqli_stmt_bind_result($stmt,$picName);
while(mysqli_stmt_fetch($stmt))
{
 if ($temp % 3==0)
   echo '&lt;tr&gt;';

 echo '&lt;td valign="top" width="150px"&gt;&lt;img src="'.$picName.'"/&gt;&lt;/td&gt;';

if ($temp % 3==0)
   echo '&lt;/tr&gt;';
++$temp;
}

?&gt;
</code></pre>

<p></p>
