Merhaba
Databasemdeki bir Tablo'nun
Image tipini Decode etmek (İçeriğini görmek ) istiyorum.
Veriyi alıp PHP ile Sitemde Göstereceğim Resim olarak.
Ama nasıl Decode Edeceğimi veya PHP ile nasıl Okuyacağımı bulamadım.
Yardımcı Olursanız sevinirim.
SQL Image veri Tipini Decode etmek.
1
●387
- 01-01-2011, 06:21:12
$query = "select resim from tabloadi where id=bilmemne"; $get = mssql_query($query); $row = mssql_fetch_assoc($get); $image = $row['resim']; function hex2bin($h) { if (!is_string($h)) return null; $r=''; for ($a=0; $a<strlen($h); $a+=2) { $r.=chr(hexdec($h{$a}.$h{($a+1)})); } return $r; } $image = hex2bin($image); header("Content-type: image/gif"); print $image; exit;