Sql blob image not rendering even with base 64 encoding. I have tried IE and chrome but both does not render. Am i doing anything wrongly?
<!DOCTYPE html>
<html>
<head>
<title>Hello!</title>
</head>
<body>
<?php
$dir = 'sqlite:C:\wamp\www\image.db';
$dbh = new PDO($dir) or die("cannot open the database");
$query = "SELECT * FROM users";
foreach ($dbh->query($query) as $row)
{
echo '<img src="data:image/jpeg;base64,' . base64_encode( $row['data'] ) . '" />';
echo '\n';
}
?>
</body>
</html>
Aucun commentaire:
Enregistrer un commentaire