I'm trying to show an image saved from SQL Server from the database to the php page I am creating. What I've done so far is I get the necessary data from the database, which is the image , and the image type(if its a jpg).
This is what I did:
$idata = base64_decode($imageResult);
imagejpeg($idata);
But it is showing an error of the following:
imagejpeg() expects parameter 1 to be resource, string given [APP\Controller\MainController.php, line 226]
How do I make the image show inside my php? Do I need to decode the data that I'm getting from the database before I could convert it?
I want to give an example but the data that I currently have is very sensitive, which is why I don't know how I could give an example.