锘??xml version="1.0" encoding="utf-8" standalone="yes"?>精品蜜桃一区二区三区,色综合久久中文综合久久牛,亚洲欧美制服综合另类http://www.aygfsteel.com/surroad/category/6923.htmlzh-cnWed, 28 Feb 2007 08:09:12 GMTWed, 28 Feb 2007 08:09:12 GMT60store and retrieve a (jpg) picture into a blob field ?http://www.aygfsteel.com/surroad/articles/27536.html椋庢竻浜戞貳椋庢竻浜戞貳Wed, 11 Jan 2006 02:33:00 GMThttp://www.aygfsteel.com/surroad/articles/27536.htmlhttp://www.aygfsteel.com/surroad/comments/27536.htmlhttp://www.aygfsteel.com/surroad/articles/27536.html#Feedback0http://www.aygfsteel.com/surroad/comments/commentRss/27536.htmlhttp://www.aygfsteel.com/surroad/services/trackbacks/27536.htmlPeter Theill, Andi Worx, Patrick Mahla,


$dbcon = OCILogon($dbUser,$dbPassword,$dbName);
$lob = OCINewDescriptor($dbcon, OCI_D_LOB);
$data = fread(fopen($form_data, "r"), filesize($form_data));
$query = "insert into IMAGE_DATA (";
$query .= "NUM_IMAGEID, STR_IMAGE_TYPE, BLO_IMAGE_DATA";
$query .= ") values (";
$query .= "NUM_ID.NEXTVAL, $form_data_type, EMPTY_BLOB()";
$query .= ") returning BLO_IMAGE_DATA into :img_blob";
$stmt = OCIParse($dbcon,$query);
OCIBindByName($stmt, ':img_blob', &$lob, -1, OCI_B_BLOB);
if (OCIExecute($stmt,OCI_DEFAULT)) {
if($lob->save($data)){
OCICommit($dbcon);
OCIFreeStatement($stmt);
echo "Blob successfully uploaded\n";
}else{
OCIFreeStatement($stmt);
echo "Couldn't upload Blob\n";
}
}
OCILogoff($dbcon);

--------------------------------------------------------------

If you use this Codesnippet, you can store BLOB to an oracledb!
The next Codesnippet you can view the images!

-------------------------------------------------------------

$dbcon = OCILogon($dbUser,$dbPassword,$dbName);
$query = "select * from IMAGE_DATA where NUM_ID=$id";
$stmt = OCIParse($dbcon, $query);
OCIExecute($stmt, OCI_DEFAULT);
while (OCIFetchInto($stmt, $row, OCI_ASSOC)) {
$data = $row["BLO_IMAGE_DATA"]->load();
}
$type = OCIResult($stmt,"STR_IMAGE_TYPE");
OCIFreeStatement($stmt);

Header( "Content-type: $type");
echo $data;

cu
AndiWorx

 



]]>
主站蜘蛛池模板: 东乡族自治县| 介休市| 礼泉县| 乳山市| 蚌埠市| 大渡口区| 中牟县| 故城县| 湛江市| 镇巴县| 遂昌县| 长岛县| 禹城市| 永福县| 南江县| 蓝山县| 万盛区| 蒙山县| 六安市| 四子王旗| 沧州市| 兴城市| 全南县| 大同市| 叶城县| 夹江县| 杭州市| 莱西市| 香港 | 阿拉善右旗| 高邑县| 南华县| 卢湾区| 太白县| 新巴尔虎左旗| 密山市| 砚山县| 清河县| 临江市| 黄浦区| 商丘市|