Dear Sirs

i stored images in mysql as varchar. i want to display them in php 
as horizotnally. The code is as bewlo which i used but it is showing 
all the images horizontaly i want to break them with the number of 2 
i mean per row only 2 images should be placed.

<table width="100%" border="1" cellspacing="0" cellpadding="0">
  <tr>
 <table width="26%" border="1" cellspacing="0" cellpadding="0">
<tr>
    
  <?php  
        
        $i=0;
        $q = mysql_query ("select * from stuff where cat_id = '1' 
and prod_featured = 'yes'");
        while ($r = mysql_fetch_array ($q))
                {
                if ($i==3)
                {
                $i=0;
                
        }       
                $i+=1;  
                ?>
<td><?php echo $r["image_name"]?></td>
        <td><img src="images/<? echo $r["image_path"]?>" /></td>

        
   <?php
}
?>
       </tr>
         


  
</table>
</tr>

  </tr>
</table>

Please help me
Regards
Azhar

Reply via email to