So I have a homework from my teacher which is display image using php pdo.
The images I store in database are just the name of the images. I have store the real images in the images_lec4.
This is the code to display it.
`
<?php else:
foreach($jokes as $joke):?>
<blockquote>
<?php $image = htmlspecialchars($joke['images'],ENT_QUOTES,'UTF-8');?>
<?= htmlspecialchars($joke['joke_text'],ENT_QUOTES, 'UTF-8') ?>
<img height="200px" width="200px" src="images_lec4/<?php echo "$image"?>">
</blockquote>
<?php endforeach;
endif;`
I don’t know where is the problem, thanks in advance.
New contributor
Ukownnho is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.