0

Hi i have a problem with the output to show the images horizontal

in have the folowing code

$connn1 = mysql_connect(SQL_HOST, SQL_USER, SQL_PASS)
or die('Could not connect to MySQL database. ' . mysql_error());
mysql_select_db(SQL_DB,$connn1);

$image=mysql_query("SELECT * FROM $weinachtfeier");
if (mysql_num_rows($image)<=0)

 echo "<br>Album does not exist or you are not logged in";
  $i = 0;
echo "<table cellspacing='3' cellpadding='4' cellspacing='9' border='1'><tr>";

//Loop through banners and display them
while($row=mysql_fetch_assoc($image)){

echo "<td>
<a href='".$row['location1']."' target='_blank'><img  src='".$row['location']."'></a><br>
<font size='2' face='arial'>
<b><a href='".$row['location1']."' target='_blank'>".$row['name']."</a></b><br>
Fotos  ".$row['albumdescription']."<br>

</td>
";

//Display images in rows of 3
if($i%3==0) {
echo "<tr></tr>";
}
//Increase counter by 1
$i++;
//Check to see rather u need to move to new row
if(($i%3==0)) {
echo "<td> </td>";
}
}
echo "</tr>";
echo "</table>";

It display as follow:
in the first row i have 1 image and than 2 empty cells
The next rows are displayed proper, 3 images horizontal.

How cab it be displayed so that the first row begins with 3 images

Thanks in advice
John

3
Contributors
3
Replies
7
Views
6 Years
Discussion Span
Last Post by aymix
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.