php从mssql读blob类型显示图像
因系统需求,将图像放入mssql中,字段类型为blob,图像为jpg类型,如下代码执行时并不能正确输出图像,麻烦各位帮忙看一下,非常感谢!!
<?php
include_once("db.class.php");
// retrieving
$db = new odbc_conn();
$result = $db->res("SELECT Img_Th_data FROM LB_IMG ");
$row = odbc_fetch_array($result);
$data = $row['Img_Th_data'];
header('Content-type: image/jpg');
echo "</br>[Img_Th_data]:</br>";
print $data;
?>