W3Cschool
恭喜您成為首批注冊(cè)用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
cubrid_lob2_export — 將 lob 對(duì)象導(dǎo)出到文件
cubrid_lob2_export(resource $lob_identifier, string $file_name): bool
cubrid_lob2_export() 函數(shù)用于保存 BLOB/CLOB 數(shù)據(jù)的內(nèi)容添加到文件中。要使用此函數(shù),您必須使用 cubrid_lob2_new() 或從 CUBRID 獲取 lob 對(duì)象 數(shù)據(jù)庫(kù)優(yōu)先。如果文件已存在,則操作將失敗。 此函數(shù)不會(huì)影響 lob 對(duì)象的光標(biāo)位置。 它操作整個(gè) lob 對(duì)象。
lob_identifier
作為 cubrid_lob2_new() 結(jié)果的 Lob 標(biāo)識(shí)符或從結(jié)果集中獲取。
filename
要存儲(chǔ) BLOB/CLOB 數(shù)據(jù)的文件名。它還支持文件的路徑。
成功時(shí)返回 true, 或者在失敗時(shí)返回 false。
示例 #1 cubrid_lob2_export() example
<?php
// Table: test_lob (id INT, contents CLOB)
$conn = cubrid_connect("localhost", 33000, "demodb", "dba", "");
cubrid_execute($conn,"DROP TABLE if exists doc");
cubrid_execute($conn,"CREATE TABLE doc (id INT, doc_content CLOB)");
cubrid_execute($conn,"INSERT INTO doc VALUES (5,'hello,cubrid')");
$req = cubrid_prepare($conn, "select * from doc");
cubrid_execute($req);
cubrid_move_cursor($req, 1, CUBRID_CURSOR_FIRST);
$row = cubrid_fetch($req, CUBRID_NUM | CUBRID_LOB);
cubrid_lob2_export($row[1], "doc_3.txt");
cubrid_lob2_close($row[1]);
cubrid_disconnect($conn);
?>
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: