Page 1 of 1

Name under image

Posted: Fri May 30, 2008 1:35 pm
by DeFacto
Hello all,

i have a table with names of images stored in it. i made a code, that collects names of images and shows those images 3 in a row, but how could i made so that name of each image would be under every of them, as now i have name of each image after every image?
Anybody could help me with that, please?

Code: Select all

 
while  ($row=mysql_fetch_assoc($result)){  ?>
<img src="<?php  echo  $row['image_name'];  ?>.png"/>
<?php $row['image_name'];  ?>
<?php
        $i=$i+1;
        if ($i>2){
            echo "<br>";
           $i=0;
                 }
 
         }

Re: Name under image

Posted: Fri May 30, 2008 3:11 pm
by Mini
Put each image+text in a div. Then add a linebreak between the <img/> and the text. 8)

Code: Select all

 
while  ($row=mysql_fetch_assoc($result)){  ?>
<div>
<img src="<?php  echo  $row['image_name'];  ?>.png"/>
<br/>
<?php $row['image_name'];  ?>
</div>
<?php
         $i=$i+1;
         if ($i>2){
             echo "<br>";
            $i=0;
                  }
  
          }
 

Re: Name under image

Posted: Fri May 30, 2008 3:20 pm
by DeFacto
Thank you for reply Mini, but if i will do that way, i will get all images in 1 column, and i need 3 columns.