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++;

 

}

 

 

 

?>

Link to comment
Share on other sites

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>

 

 

 

 

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.