本文整理汇总了PHP中ibase_blob_get函数的典型用法代码示例。如果您正苦于以下问题:PHP ibase_blob_get函数的具体用法?PHP ibase_blob_get怎么用?PHP ibase_blob_get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ibase_blob_get函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: read
function read($len)
{
if ($this->id === false) {
return '';
// wr-only blob
}
if (!($e = $this->_firstUse())) {
return $e;
}
$data = ibase_blob_get($this->blob, $len);
if ($data === false) {
return $this->_setDbError('read');
}
return $data;
}
示例2: form
function form($id = '')
{
if ($id) {
$data['id'] = $id;
$data['user_data'] = $this->data_model->get_data_by_id($id);
if (isset($data['user_data']['DESKRIPSI'])) {
$blob_data = ibase_blob_info($data['user_data']['DESKRIPSI']);
$blob_hndl = ibase_blob_open($data['user_data']['DESKRIPSI']);
$deskripsi = ibase_blob_get($blob_hndl, $blob_data[0]);
$data['user_data']['DESKRIPSI'] = $deskripsi;
}
}
$data['title'] = 'SIPTU - BERITA';
$data['main_content'] = 'master/berita';
$this->load->view('layout/template', $data);
}
示例3: read
/**
* This function advances the reader to the next record.
*
* @access public
* @override
* @return boolean whether another record was fetched
*
* @see http://php.net/manual/en/function.ibase-blob-get.php
*/
public function read()
{
$this->record = @ibase_fetch_assoc($this->command);
if ($this->record !== FALSE) {
foreach ($this->blobs as $field) {
$info = @ibase_blob_info($this->resource, $this->record[$field]);
if (is_array($info) and !$info['isnull']) {
$buffer = '';
$handle = @ibase_blob_open($this->resource, $this->record[$field]);
if ($handle !== FALSE) {
for ($i = 0; $i < $info[1]; $i++) {
$size = $i == $info[1] - 1 ? $info[0] - $i * $info[2] : $info[2];
$value = @ibase_blob_get($handle, $size);
if ($value !== FALSE) {
$buffer .= $value;
}
}
@ibase_blob_close($handle);
}
$this->record[$field] = $buffer;
} else {
$this->record[$field] = NULL;
}
}
return TRUE;
}
return FALSE;
}
示例4: _BlobDecode
function _BlobDecode($blob)
{
if (ADODB_PHPVER >= 0x5000) {
$blob_data = ibase_blob_info($this->_connectionID, $blob);
$blobid = ibase_blob_open($this->_connectionID, $blob);
} else {
$blob_data = ibase_blob_info($blob);
$blobid = ibase_blob_open($blob);
}
if ($blob_data[0] > $this->maxblobsize) {
$realblob = ibase_blob_get($blobid, $this->maxblobsize);
while ($string = ibase_blob_get($blobid, 8192)) {
$realblob .= $string;
}
} else {
$realblob = ibase_blob_get($blobid, $blob_data[0]);
}
ibase_blob_close($blobid);
return $realblob;
}
示例5: BlobDecode
/**
+----------------------------------------------------------
* BLOB字段解密函数 Firebird特有
+----------------------------------------------------------
* @access public
+----------------------------------------------------------
* @param $blob 待解密的BLOB
+----------------------------------------------------------
* @return 二进制数据
+----------------------------------------------------------
* @throws ThinkExecption
+----------------------------------------------------------
*/
public function BlobDecode($blob)
{
$maxblobsize = 262144;
$blob_data = ibase_blob_info($this->_linkID, $blob);
$blobid = ibase_blob_open($this->_linkID, $blob);
if ($blob_data[0] > $maxblobsize) {
$realblob = ibase_blob_get($blobid, $maxblobsize);
while ($string = ibase_blob_get($blobid, 8192)) {
$realblob .= $string;
}
} else {
$realblob = ibase_blob_get($blobid, $blob_data[0]);
}
ibase_blob_close($blobid);
return $realblob;
}
示例6: _readResultLOB
/**
* Read data from large object input stream.
*
* @param int $lob handle to a lob created by the createLob() function
* @param blob $data reference to a variable that will hold data to be
* read from the large object input stream
* @param int $length integer value that indicates the largest ammount of
* data to be read from the large object input stream.
* @return mixed length on success, a MDB error on failure
* @access private
*/
function _readResultLOB($lob, &$data, $length)
{
$db =& $GLOBALS['_MDB2_databases'][$this->db_index];
if (MDB2::isError($lobresult = $this->_retrieveLOB($lob))) {
return $lobresult;
}
$data = @ibase_blob_get($db->lobs[$lob]['handle'], $length);
if (!is_string($data)) {
$db->raiseError(MDB2_ERROR, NULL, NULL, 'Read Result LOB: ' . @ibase_errmsg());
}
if (($length = strlen($data)) == 0) {
$db->lobs[$lob]['EndOfLOB'] = 1;
}
return $length;
}
示例7: find_apprdate
<?php
$results = "";
$head = "\\SetWatermarkText{" . $watermark . "}\n";
$head .= "\\normalsize Биоматериал: КРОВЬ ИЗ ВЕНЫ\n\n ~~~~~~~~~~~~~~~~СОСКОБ\n\n\\vspace{3px}";
$head .= "\\vspace{-10px} \\begin{center}\\large{\\textbf{Gine-Mix максима}}\n\\vspace{3px}\\rule{1\\linewidth}{0.1mm} \n \\normalsize{\\textbf{Маркеры опухолевого роста}} \\vspace{-5px} \n\n \\end{center}";
$apprdate = find_apprdate($ordersid, $dbh);
$restm = "select o.comments_pic as com from orders ord inner join ordtask o on o.ordersid = ord.id where o.testcode =1912 and ord.id in(" . $ordersid . ")";
$row = ibase_query($restm);
$data = ibase_fetch_object($row);
$blob_data = ibase_blob_info($data->COM);
$blob_hndl = ibase_blob_open($data->COM);
$comments = ibase_blob_get($blob_hndl, $blob_data[0]);
$comments = str_replace('%', '\\%', $comments);
$comments = str_replace('_', '\\_', $comments);
ibase_blob_close($blob_hndl);
ibase_free_result($row);
$results .= "\n\n" . $comments;
$apprusergist = "";
$restm = "select u.fullname from ordtask o inner join users u on u.usernam = o.appruser inner join tests t on t.id = o.testcode where o.ordersid in(" . $ordersid . ") and t.dept =4";
$res = ibase_query($dbh, $restm);
while ($row = ibase_fetch_row($res)) {
$apprusergist .= $row[0];
}
ibase_free_result($res);
$apprpcr = "";
$restm = "select u.fullname from ordtask o inner join users u on u.usernam = o.appruser inner join tests t on t.id = o.testcode where o.ordersid in(" . $ordersid . ") and t.dept =3";
$res = ibase_query($dbh, $restm);
while ($row = ibase_fetch_row($res)) {
$apprpcr .= $row[0];
}
示例8: daftar_data_spt
function daftar_data_spt()
{
if (!isset($_POST['oper'])) {
$this->load->model('spt_model');
$id = $this->uri->segment(3);
$page = $_REQUEST['page'];
// get the requested page
$limit = $_REQUEST['rows'];
// get how many rows we want to have into the grid
$sidx = $_REQUEST['sidx'];
// get index row - i.e. user click to sort
$sord = $_REQUEST['sord'];
// get the direction if(!$sidx) $sidx =1;
$req_param = array("id" => $id, "sort_by" => $sidx, "sort_direction" => $sord, "limit" => null, "search" => $_REQUEST['_search'], "search_field" => isset($_REQUEST['searchField']) ? $_REQUEST['searchField'] : null, "search_operator" => isset($_REQUEST['searchOper']) ? $_REQUEST['searchOper'] : null, "search_str" => isset($_REQUEST['searchString']) ? $_REQUEST['searchString'] : null);
$row = $this->spt_model->get_data($req_param)->result_array();
$count = count($row);
if ($count > 0) {
$total_pages = ceil($count / $limit);
} else {
$total_pages = 0;
}
if ($page > $total_pages) {
$page = $total_pages;
}
$start = $limit * $page - $limit;
// do not put $limit*($page - 1)
if ($start < 0) {
$start = 0;
}
$req_param['limit'] = array('start' => $start, 'end' => $limit);
$result = $this->spt_model->get_data($req_param)->result_array();
// sekarang format data dari dB sehingga sesuai yang diinginkan oleh jqGrid dalam hal ini pakai JSON format
$response->page = $page;
$response->total = $total_pages;
$response->records = $count;
for ($i = 0; $i < count($result); $i++) {
$blob_data = ibase_blob_info($result[$i]['MAKSUD']);
$blob_hndl = ibase_blob_open($result[$i]['MAKSUD']);
$maksud = ibase_blob_get($blob_hndl, $blob_data[0]);
$response->rows[$i]['id'] = $result[$i]['ID_SPT'];
// data berikut harus sesuai dengan kolom-kolom yang ingin ditampilkan di view (js)
$response->rows[$i]['cell'] = array($result[$i]['ID_SPT'], $result[$i]['SPT_NO'], date('d/m/Y', strtotime($result[$i]['TANGGAL'])), $maksud, $result[$i]['DARI'] . ' - ' . $result[$i]['TUJUAN'], date('d/m/Y', strtotime($result[$i]['TANGGAL_BERANGKAT'])) . ' - ' . date('d/m/Y', strtotime($result[$i]['TANGGAL_PULANG'])), $result[$i]['KENDARAAN'], $result[$i]['NAMA_PEGAWAI_PEMBERI'], $result[$i]['ID_PEGAWAI_PEMBERI'], $result[$i]['NAMA_PEGAWAI_PENERIMA'], $result[$i]['ID_PEGAWAI_PENERIMA']);
}
echo json_encode($response);
} else {
$id = $this->input->post('id');
if ($_POST['oper'] === 'add') {
//$this->tambah_data_spt();
} else {
if ($_POST['oper'] === 'edit') {
//$this->edit_data_spt($id);
} else {
if ($_POST['oper'] === 'del') {
$this->hapus_spt($id);
}
}
}
}
}
示例9: _getNavigationData
//.........这里部分代码省略.........
$this->putCountCache($output->tables, $condition, $total_count);
}
$list_count = $output->list_count['value'];
if (!$list_count) {
$list_count = 20;
}
$page_count = $output->page_count['value'];
if (!$page_count) {
$page_count = 10;
}
$page = $output->page['value'];
if (!$page) {
$page = 1;
}
// 전체 페이지를 구함
if ($total_count) {
$total_page = (int) (($total_count - 1) / $list_count) + 1;
} else {
$total_page = 1;
}
// 페이지 변수를 체크
if ($page > $total_page) {
$page = $total_page;
}
$start_count = ($page - 1) * $list_count;
// list_order, update_order 로 정렬시에 인덱스 사용을 위해 condition에 쿼리 추가
if ($output->order) {
$conditions = $this->getConditionList($output);
if (!in_array('list_order', $conditions) && !in_array('update_order', $conditions)) {
foreach ($output->order as $key => $val) {
$col = $val[0];
if (!in_array($col, array('list_order', 'update_order'))) {
continue;
}
if ($condition) {
$condition .= sprintf(' and "%s" < 2100000000 ', $col);
} else {
$condition = sprintf(' where "%s" < 2100000000 ', $col);
}
}
}
}
$limit = sprintf('FIRST %d SKIP %d ', $list_count, $start_count);
$query = sprintf('SELECT %s %s FROM %s %s %s', $limit, $columns, implode(',', $table_list), implode(' ', $left_join), $condition);
if (strlen($query_groupby)) {
$query .= $query_groupby;
}
if ($output->order) {
foreach ($output->order as $key => $val) {
$index_list[] = sprintf("%s %s", $this->autoQuotes($val[0]), $val[1]);
}
if (count($index_list)) {
$query .= sprintf(" ORDER BY %s", implode(",", $index_list));
}
}
$query .= ";";
$result = $this->_query($query);
if ($this->isError()) {
if (!$this->transaction_started) {
@ibase_rollback($this->fd);
}
$buff = new Object();
$buff->total_count = 0;
$buff->total_page = 0;
$buff->page = 1;
$buff->data = array();
$buff->page_navigation = new PageHandler($total_count, $total_page, $page, $page_count);
return $buff;
}
$virtual_no = $total_count - ($page - 1) * $list_count;
while ($tmp = ibase_fetch_object($result)) {
foreach ($tmp as $key => $val) {
$type = $output->column_type[$key];
if ($type == null) {
foreach ($output->columns as $cols) {
if ($cols['alias'] == $key) {
$type = $output->column_type[$cols['name']];
}
}
}
if ($type == "text" || $type == "bigtext") {
$blob_data = ibase_blob_info($tmp->{$key});
$blob_hndl = ibase_blob_open($tmp->{$key});
$tmp->{$key} = ibase_blob_get($blob_hndl, $blob_data[0]);
ibase_blob_close($blob_hndl);
}
}
$data[$virtual_no--] = $tmp;
}
if (!$this->transaction_started) {
@ibase_commit($this->fd);
}
$buff = new Object();
$buff->total_count = $total_count;
$buff->total_page = $total_page;
$buff->page = $page;
$buff->data = $data;
$buff->page_navigation = new PageHandler($total_count, $total_page, $page, $page_count);
return $buff;
}
示例10: getBlob
public function getBlob($data)
{
if (isset($data)) {
$blob_data = @ibase_blob_info($data);
$blob_hndl = @ibase_blob_open($data);
$content = @ibase_blob_get($blob_hndl, $blob_data[0]);
return $content;
} else {
return '';
}
}
示例11: blob_read
function blob_read($tablename, $fieldname, $where = "0=1")
{
if ($this->debug) {
echo "<pre style=\"color : green\">Reading blob in {$tablename} ({$fieldname}) where {$where} on {$this->dbpath} <p style=\"color:purple;\"> {$sql}</p></pre>";
}
switch ($this->dbtype) {
/* Firebird Functionality */
case "firebird":
$sql = "select first 1 {$fieldname} from {$tablename} where {$where}";
$this->reset_query();
$object = $this->first_row($sql);
$fieldname = strtoupper($fieldname);
$blobfield = $object->{$fieldname};
$blob_data = ibase_blob_info($this->dbh, $blobfield);
$blob_hndl = ibase_blob_open($this->dbh, $blobfield);
$content = ibase_blob_get($blob_hndl, $blob_data[0]);
break;
/* SQLite Functionality */
/* SQLite Functionality */
case "sqlite":
$sql = "select first 1 {$fieldname} from {$tablename} where {$where}";
$this->reset_query();
$object = $this->first_row($sql);
$fieldname = strtoupper($fieldname);
$content = $object->{$fieldname};
break;
/* MYSQL Functionality */
/* MYSQL Functionality */
case "mysql":
$sql = "select first 1 {$fieldname} from {$tablename} where {$where}";
$this->reset_query();
$object = $this->first_row($sql);
$fieldname = strtoupper($fieldname);
$content = $object->{$fieldname};
break;
/* Oracle Functionality */
/* Oracle Functionality */
case "oracle":
//implement
break;
/* PGSQL Functionality */
/* PGSQL Functionality */
case "pgsql":
// testing required
$sql = "select first 1 {$fieldname} from {$tablename} where {$where}";
$this->reset_query();
$object = $this->first_row($sql);
$fieldname = strtoupper($fieldname);
$content = $object->{$fieldname};
break;
}
if ($this->debug) {
echo "<pre style=\"color : blue\">Query Executed on {$this->dbpath} \n </pre>";
}
return $content;
}
示例12: _readResultLob
/**
* Read data from large object input stream.
*
* @param int $lob handle to a lob created by the createLob() function
* @param blob $data reference to a variable that will hold data to be
* read from the large object input stream
* @param int $length integer value that indicates the largest ammount of
* data to be read from the large object input stream.
* @return mixed length on success, a MDB error on failure
* @access private
*/
function _readResultLob($lob, &$data, $length)
{
if (MDB::isError($lobresult = $this->_retrieveLob($lob))) {
return $lobresult;
}
$data = @ibase_blob_get($this->lobs[$lob]['Handle'], $length);
if (!is_string($data)) {
$this->raiseError(MDB_ERROR, NULL, NULL, 'Read Result LOB: ' . @ibase_errmsg());
}
if (($length = strlen($data)) == 0) {
$this->lobs[$lob]['EndOfLOB'] = 1;
}
return $length;
}
示例13: ibase_blob_open
function &BlobDecode($blob)
{
$blobid = ibase_blob_open($blob);
$realblob = ibase_blob_get($blobid, 299999);
// 2nd param is max size of blob -- Kevin Boillet <kevinboillet@yahoo.fr>
ibase_blob_close($blobid);
return $realblob;
}
示例14: ReadResultLOB
function ReadResultLOB($lob, &$data, $length)
{
if (!$this->RetrieveLOB($lob)) {
return -1;
}
$data = ibase_blob_get($this->lobs[$lob]["Handle"], $length);
if (GetType($data) != "string") {
$this->SetError("Read result LOB", "Could not open fetched large object field: " . ibase_errmsg());
return -1;
}
if (($length = strlen($data)) == 0) {
$this->lobs[$lob]["EndOfLOB"] = 1;
}
return $length;
}
示例15: _readLOB
/**
* Read data from large object input stream.
*
* @param array $lob array
* @param blob $data reference to a variable that will hold data to be
* read from the large object input stream
* @param int $length integer value that indicates the largest ammount of
* data to be read from the large object input stream.
* @return mixed length on success, a MDB2 error on failure
* @access protected
*/
function _readLOB(&$lob, $length)
{
$data = @ibase_blob_get($lob['handle'], $length);
if (!is_string($data)) {
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
return $db;
}
return $db->raiseError(null, null, null, 'Unable to read LOB', __FUNCTION__);
}
return $data;
}