harlequeen Posted June 27, 2009 Share Posted June 27, 2009 Hi All Don't know if someone can help me with this. I have some information which is output to a page in a table and one of the items is a picture which I have the url address of in the database. In firefox, the picture displays, but does not in ie. I'm a novice at php/mysql and can't see what the problem might be. Here is my code (please note I'm trying to piece this together myself, so my code will be a bit wayward). $sql=mysql_query("SELECT * FROM players ORDER BY `idnum` "); while(@$row=mysql_fetch_array($sql)){ //Build formatted result here echo "<table border=\"1\" class=\"trumptable\">"; echo("<h4>"); echo "<tr ><th colspan=\"2\">"; echo $row['firstName']; echo (" "); echo $row['lastName']."<br/>";"</th></tr>"; echo "<tr><td colspan=\"2\">"; echo '<center><img src="http://www.morganite-netball-club.co.uk/images/playerpics/' . $row['playerimg'] . '" height=\"280\" width=\"400\"></center><br/>'; echo "</td></tr>"; echo "<tr><td>"; echo "Position : </td><td>"; echo $row['position']."<br/>";"</td></tr>"; echo "<tr><td>"; echo "Profession : </td><td>"; echo $row['profession']."<br/>";"</td></tr>"; echo "<tr><td>"; echo "Fav Hobby : </td><td>"; echo $row['favhobby']."<br/>";"</td></tr>"; echo "<tr><td>"; echo "Fav Movie : </td><td> "; echo $row['favmovie']."<br/>";"</td></tr>"; echo "<tr><td>"; echo "Fav Music : </td><td>"; echo $row['favmusic']."<br/>";"</td></tr>"; echo "<tr><td>"; echo "Fav Book : </td><td>"; echo $row['favbook']."<br/>";"</td><td>"; echo "<tr><td>"; echo "Daddy or Chips : </td><td>"; echo $row['daddy']."<br/>";"</td><td>"; echo "<tr><td>"; echo "Cheese of Chocolate : </td><td>"; echo $row['cheese']."<br/>";"</td><td>"; echo "<tr><td>"; echo "Coke or Pepsi : </td><td>"; echo $row['coke']."<br/>";"</td><td>"; echo "<tr><td>"; echo "Brad Pitt or George Clooney : </td><td>"; echo $row['pitt']."<br/>";"</td>"; echo"</tr>"; echo "</table>"; Can anyone help please. Quote Link to comment https://forums.phpfreaks.com/topic/163883-solved-image-not-appearing-in-ie-but-does-in-firefox/ Share on other sites More sharing options...
gevans Posted June 27, 2009 Share Posted June 27, 2009 Try using this code; $sql=mysql_query("SELECT * FROM `players` ORDER BY `idnum` "); while($row=mysql_fetch_array($sql)) { //Build formatted result here echo '<table border="1" class="trumptable">'; echo'<h4>'; echo '<tr ><th colspan="2">'; echo $row['firstName']; echo ' '; echo $row['lastName'].''<br/>'; echo '</th></tr>'; echo '<tr><td colspan="2">'; echo '<center><img src="http://www.morganite-netball-club.co.uk/images/playerpics/' . $row['playerimg'] . '" height=\"280\" width=\"400\"></center><br/>'; echo "</td></tr>"; echo "<tr><td>"; echo "Position : </td><td>"; echo $row['position']."<br/>"; echo "</td></tr>"; echo "<tr><td>"; echo "Profession : </td><td>"; echo $row['profession']."<br/>"; echo "</td></tr>"; echo "<tr><td>"; echo "Fav Hobby : </td><td>"; echo $row['favhobby']."<br/>"; echo "</td></tr>"; echo "<tr><td>"; echo "Fav Movie : </td><td> "; echo $row['favmovie']."<br/>"; ech "</td></tr>"; echo "<tr><td>"; echo "Fav Music : </td><td>"; echo $row['favmusic']."<br/>"; echo "</td></tr>"; echo "<tr><td>"; echo "Fav Book : </td><td>"; echo $row['favbook']."<br/>"; echo "</td><td>"; echo "<tr><td>"; echo "Daddy or Chips : </td><td>"; echo $row['daddy']."<br/>"; echo "</td><td>"; echo "<tr><td>"; echo "Cheese of Chocolate : </td><td>"; echo $row['cheese']."<br/>"; echo "</td><td>"; echo "<tr><td>"; echo "Coke or Pepsi : </td><td>"; echo $row['coke']."<br/>"; echo "</td><td>"; echo "<tr><td>"; echo "Brad Pitt or George Clooney : </td><td>"; echo $row['pitt']."<br/>"; echo "</td>"; echo "</tr>"; echo "</table>"; If that doesn't work post the html from a 'view source' on each browser Quote Link to comment https://forums.phpfreaks.com/topic/163883-solved-image-not-appearing-in-ie-but-does-in-firefox/#findComment-864674 Share on other sites More sharing options...
harlequeen Posted June 28, 2009 Author Share Posted June 28, 2009 Hi No, that code didn't work either. Here is the relevant code from Firefox <link rel="stylesheet" href="style/trumps.css" type="text/css" > <table border="1" class="trumptable"><h4><tr ><th colspan="2">Susan Edwards<br/><tr><td colspan="2"> <center><img src="http://www.morganite-netball-club.co.uk/images/playerpics/testpic.jpg" height=\"280\" width=\"400\"></center> <br/></td></tr> and here is the same output code from IE. <link rel="stylesheet" href="style/trumps.css" type="text/css" > <table border="1" class="trumptable"><h4><tr ><th colspan="2">Susan Edwards<br/><tr><td colspan="2"> <center><img src="http://www.morganite-netball-club.co.uk/images/playerpics/testpic.jpg" height=\"280\" width=\"400\"></center> <br/></td></tr> any help would be appreciated. It's baffling me! Cheers Harlequeen Quote Link to comment https://forums.phpfreaks.com/topic/163883-solved-image-not-appearing-in-ie-but-does-in-firefox/#findComment-864971 Share on other sites More sharing options...
Daniel0 Posted June 28, 2009 Share Posted June 28, 2009 Well, notice anything wrong here? height=\"280\" width=\"400\" Quote Link to comment https://forums.phpfreaks.com/topic/163883-solved-image-not-appearing-in-ie-but-does-in-firefox/#findComment-864977 Share on other sites More sharing options...
harlequeen Posted June 28, 2009 Author Share Posted June 28, 2009 Hi I guess by your post that you can't size images like this within php code, is that it? I've removed the /" bit of the code and it does display now in ie. obviously, I didn't know that and it displays ok in firefox. Anyway, thanks for the hint... As I said, I don't know php and am trying to learn it. In Firefox, the pics display centered, but not in IE. How can I fix that? Thanks again for the help. Quote Link to comment https://forums.phpfreaks.com/topic/163883-solved-image-not-appearing-in-ie-but-does-in-firefox/#findComment-865115 Share on other sites More sharing options...
Philip Posted June 28, 2009 Share Posted June 28, 2009 No, it's not because you can't size images, but because the way you have your quotes: echo '<center><img src="http://www.morganite-netball-club.co.uk/images/playerpics/' . $row['playerimg'] . '" height=\"280\" width=\"400\"></center><br/>'; You're trying to escape a double quote, when you're echoing with single quotes. echo '<center><img src="http://www.morganite-netball-club.co.uk/images/playerpics/' . $row['playerimg'] . '" height="280" width="400"></center><br/>'; If you had done the following, you would have needed the escaping (as shown) : echo "<center><img src=\"http://www.morganite-netball-club.co.uk/images/playerpics/" . $row['playerimg'] . "\" height=\"280\" width=\"400\"></center><br/>"; Quote Link to comment https://forums.phpfreaks.com/topic/163883-solved-image-not-appearing-in-ie-but-does-in-firefox/#findComment-865116 Share on other sites More sharing options...
harlequeen Posted June 28, 2009 Author Share Posted June 28, 2009 Hi Thanks for the explanation, I understand now. Cheers Quote Link to comment https://forums.phpfreaks.com/topic/163883-solved-image-not-appearing-in-ie-but-does-in-firefox/#findComment-865146 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.