what is wrong with my code? the HTML TABLE is all screwed up
Posted: Thu Feb 13, 2003 4:34 pm
When this code runs, it prints the </TABLE> before it prints the table data code right below the opening <TABLE> tag, it prints when run:
Here is the code, why is the table messing up?
Code: Select all
<table>
<tr colspan=3><td>Pictures</td></tr></table>
<tr><td rowspan='2'><a href='showpic.php?src=image_3e46c625628a7.jpg'><img src="users/images/image_3e46c625628a7.jpg" height=200 width=200 border=0></a></td>
<td><a href='showpic.php?src=image_3e46c62563f01.jpg'><img src="users/images/image_3e46c62563f01.jpg" height=100 width=100 border=0></a></td>
<td><a href='showpic.php?src=image_3e46c6256f2e4.jpg'><img src="users/images/image_3e46c6256f2e4.jpg" height=100 width=100 border=0></a></td></tr><tr>
<td><a href='showpic.php?src=image_3e46c62570819.jpg'><img src="users/images/image_3e46c62570819.jpg" height=100 width=100 border=0></a></td>
<td><a href='showpic.php?src=image_3e46c625758f5.jpg'><img src="users/images/image_3e46c625758f5.jpg" height=100 width=100 border=0></a></td>Code: Select all
<?
echo "<table>\n<tr colspan=3><td>Pictures</td></tr>";
//Get the pictures
$query = mysql_query("SELECT * from pictures where ad_id = $_GETїid]") or die(mysql_error());
$results=mysql_num_rows($query);
//if the ad has pictures
if($results > 1) {
while($row3 = mysql_fetch_array($query, MYSQL_ASSOC)) {
$count += 1;
if($count == '1') {
$picYes .= "\n<tr><td rowspan='2'><a href='showpic.php?src=$row3їsrc]'><img src="users/images/". $row3їsrc] . "" height=200 width=200 border=0></a></td>\n";
}
elseif($count % 3 == 0) {
$picYes .= "<td><a href='showpic.php?src=$row3їsrc]'><img src="users/images/". $row3їsrc] . "" height=100 width=100 border=0></a></td></tr><tr>\n";
}
else {
$picYes .= "<td><a href='showpic.php?src=$row3їsrc]'><img src="users/images/". $row3їsrc] . "" height=100 width=100 border=0></a></td>\n";
}
}
}
//ad has no pictures
else {
$picYes = "<span class="midSecondaryHead">No Pictures</span><br><br><br>";
}
echo "</table>";