how can i show an image field in a mssql

wxdqz

New Member
Hi evrybody

how can i show an image field in a mssql table

i try this but it doesen磘 work

<?php
$hostname = "server01";
$username = "sa";
$password = "";
$dbName = "luchonet";
$query = "SELECT foto_id, foto_imagen FROM recetas_fotos where (foto_id='20001211-152930581')";
mssql_connect ($hostname,$username,$password);
mssql_select_db ($dbName);

$result = MSSQL_QUERY($query);
$number = MSSQL_NUM_ROWS($result);

$i=0;

if ($number > 0) {
while ($i < $number) :
$id = mssql_result($result,$i,"foto_id");
$img = mssql_result($result,$i,"foto_imagen");

header('Content-type: image/x-ms-bmp');
echo $img;
$i++;
endwhile;
};
?>

Please hlep me!!!

thanks
 
Back
Top