php - Why does it shows "Failed to load PDF File document"?

one text

I've been stuck in this problem for a while now. I have a table name pdf_file and I've already uploaded pdf blob files in there. I also can retrieve the blob files from the table but the problem is, it doesn't display the uploaded file.

Here's my code:

<?php
$database = new mysqli("localhost","root","","dbStudent");
$sql = "SELECT file FROM pdf_file WHERE id = ?";
$stmt = $database->prepare($sql);
$stmt->bind_param('s',$id);
$stmt->execute();
$result = $stmt->get_result();
$row = $result->fetch_array();
echo '<iframe style="height:800px;width:90%" src ="data:application/pdf;base64,'.base64_encode($row['file']).'"/>';
?>

Source