Hi, I am a newbie in PHP and Mysql and i�m trying to show a blob field from a Mysql
database in to a browser. Could anyone help me.
Thanks.
The Code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Teste.php</title>
</head>
<BODY BGCOLOR=#3366FF>
<CENTER>
<FORM>
<h1> Kompatscher & Cia Ltda </h1>
<hr>
<?php
$con = mysql_connect(*****************) or die ("Erro ao conectar!");
mysql_select_db("**************", $con) or die ("Erro ao selecionar a database!");
$comando="SELECT codigo,nome,material,temperatura,pressao,fluido,descricao,foto FROM
cadgrupo WHERE codigo=10";
$res = mysql_query($comando,$con);
$linha = mysql_fetch_array($res);
echo "<TABLE ALIGN=CENTER>";
echo "<tr>";
echo "<td>";
echo "Foto";
echo "</td>";
echo "<td>";
$i= $linha['foto'] ;
$len=strlen($i);
header("Content-type: image/jpeg");
header("Content-Length: $len");
header("Content-Disposition: inline; filename=temp.jpg");
echo "<input type=image src=temp.jpg border=0>";
echo "</td>";
echo "</tr>";
echo "</TABLE>";
mysql_close($con);
?>
</FORM>
</CENTER>
</BODY>
</html>
The anwser of the browse
Kompatscher & Cia Ltda
--------------------------------------------------------------------------------
Foto
Warning: Cannot add header information - headers already sent by (output started
at C:\Inetpub\wwwroot\Teste.php:11) in C:\Inetpub\wwwroot\Teste.php on line 25
Warning: Cannot add header information - headers already sent by (output started
at C:\Inetpub\wwwroot\Teste.php:11) in C:\Inetpub\wwwroot\Teste.php on line 26
Warning: Cannot add header information - headers already sent by (output started
at C:\Inetpub\wwwroot\Teste.php:11) in C:\Inetpub\wwwroot\Teste.php on line 27