1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| <?php
header("Content-type: image/jpeg");
$dbhost = "localhost";
$dbuser = "root"; // mysql user
$dbpass = ""; // mysql password
$dbname = "testb"; // mysql database
$conn=mysql_connect($dbhost,$dbuser,$dbpass) or die(erreurServeurMySQL());
mysql_select_db($dbname) OR die;
$requete="select photo from etudiants where cne=23208";
$resultat=mysql_query($requete,$conn);
while ($tableau=mysql_fetch_array($resultat)){
//affichage de l image
$image=$tableau[0];
echo $image;
imagejpeg($image, "C:/Program Files/EasyPHP1-8/www/monimage.jpg");
} |