我在我的Oracle數據和笨代碼點火器中的錯誤clob(oracle)值,如何解決?
$this->db->select('detail');
$r = $this->db->get($tableName);
$result = $r->result();
的print_r($結果)檢索:
Array
(
[0] => stdClass Object
(
[DETAIL] => OCI-Lob Object
(
[descriptor] => Resource id #80
)
)
[1] => stdClass Object
(
[DETAIL] =>
)
[2] => stdClass Object
(
[DETAIL] => OCI-Lob Object
(
[descriptor] => Resource id #80
)
)
)
數據模型:
function get_ora_blob_value($value)
{
$size = $value->size();
$result = $value->read($size);
return ($result)?$result:NULL;
}
檢索數據:
echo $this->data->get_ora_blob_value($result[0][DETAIL]); // should be 'remark1'
echo "<br />";
echo $this->data->get_ora_blob_value($result[1][DETAIL]); // should be null
echo "<br />";
echo $this->data->get_ora_blob_value($result[2][DETAIL]); // should be 'remark2'
印:
remark2
(empty)
(empty)
爲什麼第一個數據有第三個數據的值?第三個數據變空了?
'print_r($ r-> result_array())'的結果是什麼?如果使用'foreach($ result as $ single_result)'檢索數據,會打印什麼? – castt 2012-10-03 07:23:07