me devuelve este resultado i no la foto
http://localhost/php/cacau30/foto.php?id_foto=0000
CREATE TABLE IF NOT EXISTS foto (
id_foto SMALLINT(4) UNSIGNED ZEROFILL NOT NULL,
nombre_foto VARCHAR(50) UNIQUE NOT NULL,
foto MEDIUMBLOB NOT NULL,
categoria_foto VARCHAR(50) NOT NULL,
format_foto VARCHAR(50) NOT NULL,
foto_id_producte SMALLINT (3) UNSIGNED ZEROFILL NOT NULL,
CONSTRAINT pk_id_foto PRIMARY KEY (id_foto),
)ENGINE=InnoDB;
insert
id_foto nombre_foto foto categoria_foto formato_foto foto_id_producte
0000 foto.jpeg [BLOB - 7.2 KB] reposteria image/jpeg 000
indice.html
<li><a href="foto.php?id_foto=0000">foto</a></li>
foto.php
<?
header("Content-Type: image/jpeg");
$link = mysqli_connect($hostname,$user,$password,$database );
$query = "select foto from foto where id_foto= $_GET[id_foto] ";
$result = mysqli_query($link, $query);
/* associative array */
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)){
echo "{$row['foto']}<br>\n";
}
/* free result set */
mysqli_free_result($result);
/* close connection */
mysqli_close($link);
?>