0

I have some troubles displaying my blob image ,Here is the code I am using :

if ($pass==$dbpass&&$id== $dbid) {
$queryimage = mysql_fetch_array(mysql_query("SELECT `images` FROM `attestation` WHERE id='$id' "))[0];

header('Content-Type: image/png'); 
echo $queryimage;

@$_SESSION['id']=$id;
}
  • 1
    so what are "some troubles "? – RomanPerekhrest Jan 10 '16 at 11:08
  • 1
    Please dont use the `mysql_` database extensions, it is deprecated (gone for ever in PHP7) Especially if you are just learning PHP, spend your energies learning the `PDO` or `mysqli_` database extensions, [and here is some help to decide which to use](http://stackoverflow.com/questions/12859942/why-shouldnt-i-use-mysql-functions-in-php) – RiggsFolly Jan 10 '16 at 11:08
  • 1
    refer http://stackoverflow.com/questions/7793009/how-to-retrieve-images-from-mysql-database-and-display-in-an-html-tag – Vigneswaran S Jan 10 '16 at 11:11
  • You really shouldn't use `@` to suppress errors. Validate variables and log errors instead. Otherwise you will have a real pain debugging your code. – M. Eriksson Jan 10 '16 at 11:14

0 Answers0