Skip to content

获取BLOB大对象数据

使用范例

<?php
......
$lob=fopen('./002.jpg', "wb");

$stmt = $db->prepare("SELECT C2 FROM PHP_LOB;");
$stmt->execute();

$stmt->bindColumn(1, $contex, PDO::PARAM_LOB);
$stmt->fetch(PDO::FETCH_BOUND);

while(!feof($contex)){
    fwrite($f_clob, fgets($contex, 102400));
}

Fclose($lob);
?>