1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
$mysql_host = "myhost";
$mysql_database = "mabase";
$mysql_user = "username";
$mysql_password = "password";
$con = mysql_connect($mysql_host,$mysql_user,$mysql_password);
$db = mysql_select_db($mysql_database);
if ((!$con)&&(!$db)){
die('Could not connect: ' . mysql_error());
}
else echo "connected";
$query = " SELECT * FROM personne WHERE id_personne=184 ";
$res=mysql_query($query);
header('content-type: image/jpeg');
print imagejpeg(imagecreatefromstring(mysql_result($res, 4, "personne_image"))); |