0

Hi, i need help , i wanted images to be for instance 4 in row, before it goes on to the next row, and below the images i wanted a title there.

This are my work so far, but i just cant get to what I wanted, i've been searching for days, please help ):

<?php
	  $displayPhoto = "";
	
      $a = 0;
	  while($row = mysql_fetch_array($result)){
			$a++;
			$displayPhoto .= "<tr><img src='image/".$row['image']."' height=200px width=200px /></tr>"."<tr>".$row['title']."</tr>";
		
			if (($a%4) == 0){
			$displayPhoto .="<br/><br/>";
		
			}
			 }
			 echo $displayPhoto;
             ?>

and

<?php
	  $displayPhoto = "";
	  $displayBrand = "";
      $a = 0;
	  while($row = mysql_fetch_array($result)){


              ?><p>&nbsp;</p>
           	 <table width="168" border="0" align="center">

                         <tr>
                              <td><img src="image/<?php echo $row['image']; ?>" width="133" height="180" /></td>          </tr>
                          </tr>
                          <tr>

                               </tr>
                          <tr>
                              <td><div align="center"><span class="style6">Brand: <?php echo $row['brand']; ?></span></div></td>
                          </tr>
                          </table>          <p>&nbsp;</p></td>
                            </tr><tr bgcolor="#6699FF"><td height="20" valign="top" bgcolor="#FFFFFF">&nbsp;</td>
                            </tr>
                           <p>
 <?php	} ?>
2
Contributors
5
Replies
6
Views
6 Years
Discussion Span
Last Post by oinkpink
0

i've tried, but i don't understand why is my if statement underlined ):

0

i got it ! however how can i place the title under each of the images?

<?php
      $count = 0;
	  while($row = mysql_fetch_array($result)){
                 if ($count % 4 == 0)
                     echo '<tr>';
                 echo "<td><img src='image/".$row['image']."' height=200px width=200px /></td>";
                    if ($count % 4 == 3)
                     echo '</tr>';
                 $count++;  }
             ?>
0

OMG AWESOME!
I didnt thought of adding beside it, i tried putting under and after <tr>

Thank you sooooo much pritaeas !
Really thanks so much

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.