Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Newbie PHP Help - Echo Images

$
0
0

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.

 


Viewing all articles
Browse latest Browse all 13200

Trending Articles