Jump to content

[SOLVED] Using a while loop to display tables, works in firefox/opera but NOT IE7, help!


nzfade

Recommended Posts

Heres the link :

 

http://www.studiokai.co.nz/products_lowcostawards.php?&make=1

 

Basically it displays 4 columns across, while going through a mysql database...but in IE7 falls apart, when i copy the code back, into dreamweaver, it looks exactly how it should be.....any help would be hugely appreciated.

 

Thanks in Advance

 

 

Here's the code

 

 

$make = $_GET["make"];

 

// Metal Cup Range

 

//$result = @mysql_query("SELECT * FROM tbl_Products WHERE make = '1' && model = 'Metal Cup Range' ");

$result = @mysql_query("SELECT * FROM tbl_Products WHERE make = '1' ");

 

$row_count = 1;

$cols = 4;

 

 

 

// If else statement for make

 

//echo 'Low Cost Awards</br>';

//echo 'Click on any Image to see Price & Quality Picture</br></br>';

 

//echo 'Metal Cup Range</br></br>';

 

while ($row = mysql_fetch_array($result))

{

$product_id = $row["product_id"];

 

if ($row_count %$cols == 0)

{

echo "<td><center>";

//echo $row_count;

echo '</br>';

echo '</br>';

echo $row["product_size"]." <p>";

echo "<a href='index.php?&product_id=$product_id'><img src='products/large/" . $row['image' ] . " ' ' /><br></a>";

 

echo $row["product_title"]." ";

    echo "</center></td>";

 

echo"</tr><tr>";

 

}

else

{

echo "<td><center>";

//echo $row_count;

echo '</br>';echo '</br>';

echo $row["product_size"]." <p>";

echo "<a href='index.php?&product_id=$product_id'><img src='products/large/" . $row['image' ] . " ' ' /><br></a>";

 

echo $row["product_title"]." ";

echo "</center></td>";

 

}

 

$row_count++;

 

}

 

 

 

?>

The only site that needs to work in IE 7 is getfirefox.com.

 

~ Firefox - Rediscover the web ~

 

While I wasn't able to really see the problem with the code, I'd recommend you view source on the page. As it stands everything is ending up in one cell which a bunch of center tags around it.

when i drag the generated html code out, it basically gives me

 

<table>

<tr>

  <td></td>

    <td></td>

    <td></td>

    <td></td>

</tr>

<tr>

  <td></td>

    <td></td>

    <td></td>

    <td></td>

</tr>

<tr>

  <td></td>

    <td></td>

    <td></td>

    <td></td>

</tr>

<tr>

    <td></td>

    <td></td>

    <td></td>

    <td></td>

</tr>

 

</tr>  this is an extra one, but I don't see it causing the problems......or is it?

 

</table>

 

 

 

 

 

for echoing talbes I always echo the closures after wards and just assumed close them outside the loop because it will always need a closing.

 

 

---------------------------

 

are you able to give a quick example?  I'm not to sure what you mean

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.