ded Posted July 21, 2009 Share Posted July 21, 2009 Need some help: This code works fine...all images appear: while($row = mysql_fetch_array($result)) { $photo = "<a href=http://www.website.com/images/items/" . $row['picture'] . " target=_blank><img src=http://www.website.com/images/items/" . $row['picture'] . " height=20% width=20% border=0></a><br>"; echo $photo; echo "<b>Item #: " . $row[item] . "</b><br>"; echo "<b>" . $row[desc] . "</b><br>"; echo "<b>$" . $row[retail] . ".00</b><br>"; } There are 100's of records, so I want to put into a table so it show up nice. However, when I add the table code, the images disappear. Everything else if fine. echo "<table><tr><td>"; while($row = mysql_fetch_array($result)) { $photo = "<a href=http://www.website.com/images/items/" . $row['picture'] . " target=_blank><img src=http://www.website.com/images/items/" . $row['picture'] . " height=20% width=20% border=0></a><br>"; echo $photo; echo "<b>Item #: " . $row[item] . "</b><br>"; echo "<b>" . $row[desc] . "</b><br>"; echo "<b>$" . $row[retail] . ".00</b><br>"; } echo "</td></tr></table>"; Quote Link to comment https://forums.phpfreaks.com/topic/166727-solved-image-in-table-not-appearing/ Share on other sites More sharing options...
MadTechie Posted July 21, 2009 Share Posted July 21, 2009 try this, echo "<table><tr><td>"; echo "<tr><td>testing</td></tr>"; while($row = mysql_fetch_array($result)) { $img = urlencode($row['picture']); $photo = "<a href=\"http://www.website.com/images/items/$img\" target=\"_blank\"><img src\"=http://www.website.com/images/items/$img\" height=\"20%\" width=\"20%\" border=\"0\"></a><br>"; echo $photo; echo "<b>Item #: " . $row['item'] . "</b><br>"; echo "<b>" . $row['desc'] . "</b><br>"; echo "<b>$" . $row['retail'] . ".00</b><br>"; } echo "</td></tr></table>"; Quote Link to comment https://forums.phpfreaks.com/topic/166727-solved-image-in-table-not-appearing/#findComment-879147 Share on other sites More sharing options...
ded Posted July 21, 2009 Author Share Posted July 21, 2009 Still no luck Quote Link to comment https://forums.phpfreaks.com/topic/166727-solved-image-in-table-not-appearing/#findComment-879152 Share on other sites More sharing options...
MadTechie Posted July 21, 2009 Share Posted July 21, 2009 Just to confirm, does this work? #echo "<table><tr><td>"; while($row = mysql_fetch_array($result)) { $photo = "<a href=http://www.website.com/images/items/" . $row['picture'] . " target=_blank><img src=http://www.website.com/images/items/" . $row['picture'] . " height=20% width=20% border=0></a><br>"; echo $photo; echo "<b>Item #: " . $row[item] . "</b><br>"; echo "<b>" . $row[desc] . "</b><br>"; echo "<b>$" . $row[retail] . ".00</b><br>"; } #echo "</td></tr></table>"; Quote Link to comment https://forums.phpfreaks.com/topic/166727-solved-image-in-table-not-appearing/#findComment-879160 Share on other sites More sharing options...
ded Posted July 21, 2009 Author Share Posted July 21, 2009 Yes it does....as soon as I add in the <table> info, the images dissappear, but everything else is still in place. Quote Link to comment https://forums.phpfreaks.com/topic/166727-solved-image-in-table-not-appearing/#findComment-879161 Share on other sites More sharing options...
ded Posted July 21, 2009 Author Share Posted July 21, 2009 bump Quote Link to comment https://forums.phpfreaks.com/topic/166727-solved-image-in-table-not-appearing/#findComment-879370 Share on other sites More sharing options...
MadTechie Posted July 21, 2009 Share Posted July 21, 2009 even when you view source ? Quote Link to comment https://forums.phpfreaks.com/topic/166727-solved-image-in-table-not-appearing/#findComment-879746 Share on other sites More sharing options...
ded Posted July 23, 2009 Author Share Posted July 23, 2009 The view source shows the img code, but the image does not appear on the website. Again, if I take out the <table>, the image does appear. <table><tr><td><img src=http://www.website.com/images/items/75149.gif height=15% width=15% border=0><br><b>Item #: 12345</b><br><b>kl jfdskfdsl ls</b><br><b>$25.00</b><br><img src=http://www.website.com/images/items/75149.gif height=15% width=15% border=0><br><b>Item #: 544556</b><br><b>ihfdsyuyfdshkjf hksj</b><br><b>$36.00</b><br><img src=http://www.website.com/images/items/75149.gif height=15% width=15% border=0><br><b>Item #: 41475</b><br><b>i dfyeui riuewui dfsa</b><br><b>$8.00</b><br><img src=http://www.website.com/images/items/75149.gif height=15% width=15% border=0><br><b>Item #: 48976</b><br><b>rjf dsh fwje hrwqhjf khkfyshjb fj.d</b><br><b>$45.00</b><br><img src=http://www.website.com/images/items/75149.gif height=15% width=15% border=0><br><b>Item #: 5644654</b><br><b>oifp diy fuiweh kfkjgy uisdhighdfaj,hoi</b><br><b>$18.00</b><br><img src=http://www.website.com/images/items/75149.gif height=15% width=15% border=0><br><b>Item #: 432498328</b><br><b>fj hdshf dashh fjk</b><br><b>$89.00</b><br><img src=http://www.website.com/images/items/75149.gif height=15% width=15% border=0><br><b>Item #: 4896324782</b><br><b>kjfhdfjkdsufjkdsk</b><br><b>$199.00</b><br></td></tr></table> Quote Link to comment https://forums.phpfreaks.com/topic/166727-solved-image-in-table-not-appearing/#findComment-881263 Share on other sites More sharing options...
MadTechie Posted July 23, 2009 Share Posted July 23, 2009 works fine for me, but i still say add the quotes back in Quote Link to comment https://forums.phpfreaks.com/topic/166727-solved-image-in-table-not-appearing/#findComment-881395 Share on other sites More sharing options...
ded Posted July 24, 2009 Author Share Posted July 24, 2009 Here is a test page.....you can check it out http://mlhessentials.com/test.php Quote Link to comment https://forums.phpfreaks.com/topic/166727-solved-image-in-table-not-appearing/#findComment-881572 Share on other sites More sharing options...
ded Posted July 24, 2009 Author Share Posted July 24, 2009 I found the problem....it has to do with the height=15% and width=15% portion. I changed that to height=100 and width=100 and it works just fine. Anyone have an idea of why? Regards, DED Quote Link to comment https://forums.phpfreaks.com/topic/166727-solved-image-in-table-not-appearing/#findComment-881618 Share on other sites More sharing options...
MadTechie Posted July 24, 2009 Share Posted July 24, 2009 styling problem test page is down! Quote Link to comment https://forums.phpfreaks.com/topic/166727-solved-image-in-table-not-appearing/#findComment-881623 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.