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

change your line no 10

$i = 0;

set $i to 1

$i=1;

Wonderful......You just made my day

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.