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. Quote Link to comment Share on other sites More sharing options...
Solution ZulfadlyAshBurn Posted April 28, 2013 Solution 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? Quote Link to comment 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 Quote Link to comment 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.