Fetch blob image from table and display it using php sqlite3 Fetch blob image from table and display it using php sqlite3 sqlite sqlite

Fetch blob image from table and display it using php sqlite3


Create an image.php:

<?php $sql = "SELECT user_profile_picture FROM profile WHERE id = " . $_GET['id'];$query = $db->query($sql);$row = $query->fetchArray(SQLITE3_ASSOC);header('Content-Type: image/png');echo $row['user_profile_picture'];

In profile.php:

<img src='image.php?id=<?php echo $row['id'];?>'/>