for($i=1; $i<=$num; $i++){ ?>
  <tr>

    <td valign="top" align="center" width="528">
     <div style="width:510px; padding-top:10px; align="center">
        <?
		
	 $j = min( $i + 4, $num);
	  
	  	for($i=$i; $i<=$j; $i++){ 
	  		$row=mysql_fetch_assoc($result);
	  ?>
     
                 <div style="height:75px; width:90px; float:left; padding-left:24px"><a href="link" >
                     <?
					if($row['picture'] && file_exists("image/products/".$row['picture'])){	
					list($width, $height, $type, $attr) = getimagesize("image/products/".$row['picture']);
								echo "<img src=\"image/products/".$row['picture']."\" style=\"border:none;\" >";
						
					}else
						echo "<img style=\"border:none;\" src=\"image/blank_small.gif\">";
					?>
                    </a><br />
                   <div> <a href="link" ><?=$row['name']?></a></div>
                 </div>
                  <? }  $i--; ?>
                  <? } // ?>
                  </div>
                  </td></tr>

kodum böyle bir şey. yanlış bir şey mi yapıyorum?