I select an image from a database table and save it in a variable:
(Connection already established)
require('fpdf.php');
$sql = "SELECT * FROM users WHERE ID=1";
$result = $dbConnection->query($sql);
$row = $result->fetch_assoc();
$id = $row['ID'];
$image = $row['Profile'];
//Encode the image selected
$img = 'data://text/plain;base64,' . base64_encode($image);
//FPDF STUFF
$pdf = new FPDF();
$pdf->AddPage();
$pdf->Image($img,10,10,39,'jpg');
$pdf->Cell(0,8,$id,0,1);
Then i get this error Message when trying to run the php script:
Fatal error: Uncaught Exception: FPDF error: Image file has no extension and no type was specified: data://text/plain;base64, [BINARY IMAGE DATA] in C:\xampp\htdocs\fpdf.php on line 271
So what am i supposed to do? Or what did i do wrong? (Code Snippet was found on GitHub)