i have inserted the image in the form of boolean format but while retrieving i’m getting a error
" Trying to access array offset on value of type bool in …"
code:
<?php
require_once "pdo.php";
$_query="SELECT * FROM tbl_images ORDER BY id DESC";
$all_profiles = $pdo->query($_query);
while ( $row = $all_profiles->fetch(PDO::FETCH_OBJ) )
{
$profiles[] = $row;
}
?>
<html>
...
<body>
...
<?php if (empty($profiles))
{
echo'<p>No rows found</p>';
}
else
{
foreach($profiles as $profile)
{
echo '
<div class="col-lg-4 col-md-6 mb-5">
<a href="data:image/jpeg;base64,'.base64_encode($row['name'] ).'" class="d-inline-block">
<img src="data:image/jpeg;base64,'.base64_encode($row['name'] ).'" alt="Image" class="img-fluid">
</a>
<h3 style="color: #fff" > '; echo $profile->description ;'</h2>
</div>
';
}
}
?>
...
</body>
</html>