Hi,
To upload try this:
$dstlink = mysql_connect ("host", "user", "pwd")
or die ("error on connect");
mysql_select_db("pneuf")
or die ("error on open database");
$data = addslashes(fread(fopen("images.gif", "rb"), filesize("images.gif")));
$query="UPDATE cercatrova SET FOTO='$data' WHERE ID='".$ID."'";
mysql_query ($query)
or die ("MySql Error on line :".mysql_error());
To show just this:
$dstlink = mysql_connect ("host", "user", "pwd")
or die ("error on connect");
mysql_select_db("pneuf")
or die ("error on open database");
$query="select * from cercatrova "
$result=mysql_query($query);
$row=mysql_fetch_array($result);
$foto=$row["Foto"];
header('Content-type: image/gif');
echo $foto;
Call this last piece of code like "getimg.php" and use it in a <img> tag as source:
<img src="getimg.php?ID=1">
see you
P.s: pay attention on addslashes / stripslashes. I use only addslashes on input data, but for some host want also stripslashes($foto) (on the output data...)
P.P.S: if you change the header you can use with jpeg or other mime type.