jonesypeter Posted April 28, 2013 Share Posted April 28, 2013 Hi, I'm trying to display some records from a MySQL database which worked fine. I have now changed the code to display in image and I seem to have broken it. Could anybody help me sort this out? Many thanks Peter Jones // Table header. echo '<table align="center" cellspacing="3" cellpadding="3" width="75%"> <tr><td align="left"><b>Title</b></td><td align="left"><b>Publisher</b></td><td align="left"><b>Release Year</b></td></tr> '; // Fetch and print all the records: while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)) { echo '<tr><td align="left"><img src="/images/spectrum/game/' . $row['image'] . '" alt="some_text">' . '</td><td align="left">' . $row['publisher'] . '</td><td align="left">' . $row['rel_year']. '</td></tr> } echo '</table>'; // Close the table. Link to comment https://forums.phpfreaks.com/topic/277386-newbie-php-help-echo-images/ Share on other sites More sharing options...
ZulfadlyAshBurn Posted April 28, 2013 Share Posted April 28, 2013 // Table header. echo '<table align="center" cellspacing="3" cellpadding="3" width="75%"> <tr><td align="left"><b>Title</b></td><td align="left"><b>Publisher</b></td><td align="left"><b>Release Year</b></td></tr> '; // Fetch and print all the records: while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)) { echo '<tr><td align="left"><img src="/images/spectrum/game/' . $row["image"] . '" alt="some_text">' . '</td><td align="left">' . $row["publisher"] . '</td><td align="left">' . $row["rel_year"]. '</td></tr>'; } echo '</table>'; // Close the table. try this? Link to comment https://forums.phpfreaks.com/topic/277386-newbie-php-help-echo-images/#findComment-1426976 Share on other sites More sharing options...
jonesypeter Posted April 29, 2013 Author Share Posted April 29, 2013 Hello, Many thanks for this. I am now all sorted. Best wishes Peter Jones Link to comment https://forums.phpfreaks.com/topic/277386-newbie-php-help-echo-images/#findComment-1427100 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.