コード例 #1
0
 function UpdateBlobFile($table, $column, $path, $where, $blobtype = 'BLOB')
 {
     pg_exec($this->_connectionID, "begin");
     $fd = fopen($path, 'r');
     $contents = fread($fd, filesize($path));
     fclose($fd);
     $oid = pg_lo_create($this->_connectionID);
     $handle = pg_lo_open($this->_connectionID, $oid, 'w');
     pg_lo_write($handle, $contents);
     pg_lo_close($handle);
     // $oid = pg_lo_import ($path);
     pg_exec($this->_connectionID, "commit");
     $rs = ADOConnection::UpdateBlob($table, $column, $oid, $where, $blobtype);
     $rez = !empty($rs);
     return $rez;
 }
コード例 #2
0
ファイル: adodb-postgres.inc.php プロジェクト: qoire/portal
 function UpdateBlobFile($table, $column, $val, $where, $blobtype = 'BLOB')
 {
     pg_exec($this->_connectionID, "begin");
     $oid = pg_lo_import($val);
     pg_exec($this->_connectionID, "commit");
     $rs = ADOConnection::UpdateBlob($table, $column, $oid, $where, $blobtype);
     $rez = !empty($rs);
     return $rez;
 }