Hello i am trying to retrieve image stored in database as BLOB however it is coming back as broken so the image doesnt display what am i doing wrong code below.
<?php
$connect = mysqli_connect("localhost", "root", "", "testing");
$query = "SELECT * FROM item ORDER BY item_id DESC";
$result = mysqli_query($connect, $query);
while($row = mysqli_fetch_array($result)){
echo '<tr>';
echo '<td>';
echo '<img src="data:image/jpeg;base64,'.base64_encode($row['photo'] ).'" height="100" width="100" class="img-thumnail" />';
echo '</td>';
echo '</tr>';
}
?>