I'm trying to show pictures stored in a database but when I run the code, a brunch of text of the picture comes up. (shown in the image below)
here's my code for displaying the contents of the database
<?php
include ("connectdb.php");
try {
$rows = $db -> query("SELECT animal_id, title, animal_dob, animal_type, animal_description,picture_of_animal FROM animals");
?> <table>
<tr>
<th> Animal id <th> Title </th> <th> Date of birth </th> <th> Type </th><th>Description</th><th>Picture</th>
</tr> <?php
foreach ($rows as $rows => $r) {
?>
<tr>
<td><?php echo $r['animal_id']; ?></td>
<td><?php echo $r['title']; ?> </td>
<td><?php echo $r['animal_dob']; ?> </td>
<td><?php echo $r['animal_description']; ?> </td>
<td><img src "<?php echo $r['picture_of_animal']; ?>" </td>
</tr>
<?php
}
?>
</table>;
<?php
}catch (PDOException $ex) {
?>
<p>Sorry, a database error occurred.</p>
<p> Error details: <em> <?= $ex->getMessage() ?> </em></p>
<?php
}
?>