
Try use the php script as the image in the <img> tag: <img src="script.php"> On Wed, Mar 17, 2010 at 10:55 AM, ukuta ken <ukutaken@gmail.com> wrote:
hello
scenario --------------
images stored as binary in sybase odbc-connection
swali --------
how do i view the image in a browser? i have tried (almost) everything in vain.
this is my code ------------------------
<?php
function hex2bin($data){ $len = strlen($data); return pack("H" . $len, $data); }
$connH=odbc_pconnect("myDB","me","mypassword") or die(odbc_errormsg()); $result=odbc_exec($connH, "select top 1 image from images where id='1'"); if ($result) { odbc_longreadlen($result, 131072); odbc_binmode($result,ODBC_BINMODE_CONVERT); $m_FValue=odbc_result($result, 1); header("Content-Type: image/jpeg"); echo $out=hex2bin($m_FValue); } ?> _______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Regards, Brian Ngure