当前位置: 首页>>代码示例>>PHP>>正文


PHP ibase_fetch_object函数代码示例

本文整理汇总了PHP中ibase_fetch_object函数的典型用法代码示例。如果您正苦于以下问题:PHP ibase_fetch_object函数的具体用法?PHP ibase_fetch_object怎么用?PHP ibase_fetch_object使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ibase_fetch_object函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: recupera_campo

function recupera_campo($campo,$tabela,$campo_condicao,$condicao) {

    $consulta = "SELECT $campo FROM $tabela WHERE $campo_condicao = $condicao";
    $resultado = ibase_query($consulta);
    $registro = ibase_fetch_object($resultado);
    $campo = $registro->$campo;
    return $campo;
}
开发者ID:helbertfurbino,项目名称:sgmofinanceiro,代码行数:8,代码来源:paginacao.php

示例2: FetchAs

 function FetchAs($result)
 {
     if (!is_resource($result)) {
         return false;
     }
     return ibase_fetch_object($result);
     //cambio de fetch_assoc por fetch_row
 }
开发者ID:cafaray,项目名称:pegasoFtc,代码行数:8,代码来源:database.php

示例3: sendSMS

 function sendSMS()
 {
     global $database;
     $sql = $database->query("SELECT * FROM SYSSETTINGS");
     while ($row = ibase_fetch_object($sql)) {
         $this->tumasmsusername = $row->SMSUSERNAME;
         $this->tumasmspassword = $row->SMSPASSWORD;
         $this->sms_from = $row->SMSSENDERID;
     }
 }
开发者ID:Kemallyson,项目名称:Wizglobal,代码行数:10,代码来源:tuma_sms.php

示例4: gcms_fetch_object

function gcms_fetch_object($nresult)
{
    $result = ibase_fetch_object($nresult);
    if ($result) {
        $coln = ibase_num_fields($nresult);
        for ($i = 0; $i < $coln; $i++) {
            $col_info = ibase_field_info($nresult, $i);
            eval("\$result->" . strtolower($col_info['alias']) . " = \$result->" . $col_info['alias'] . ";");
        }
    }
    return $result;
}
开发者ID:ibnoe,项目名称:simpatda-thinkfrogs,代码行数:12,代码来源:firebird.php

示例5: executeQuery

 public function executeQuery($sql)
 {
     try {
         $this->openConnection();
         $this->rtemp = ibase_query($this->connection, $sql);
         while ($row = ibase_fetch_object($this->rtemp)) {
             $this->result[] = $row;
         }
         $this->freeResult();
         $this->closeConnection();
     } catch (Exception $ex) {
         $this->logger->log("Exception while connection with firebird database... {$ex}");
     }
 }
开发者ID:solutionsCluster,项目名称:silar,代码行数:14,代码来源:FirebirdConnector.php

示例6: _sql_report

 /**
  * Build db-specific report
  * @access private
  */
 function _sql_report($mode, $query = '')
 {
     switch ($mode) {
         case 'start':
             break;
         case 'fromcache':
             $endtime = explode(' ', microtime());
             $endtime = $endtime[0] + $endtime[1];
             $result = @ibase_query($this->db_connect_id, $query);
             while ($void = @ibase_fetch_object($result, IBASE_TEXT)) {
                 // Take the time spent on parsing rows into account
             }
             @ibase_free_result($result);
             $splittime = explode(' ', microtime());
             $splittime = $splittime[0] + $splittime[1];
             $this->sql_report('record_fromcache', $query, $endtime, $splittime);
             break;
     }
 }
开发者ID:BACKUPLIB,项目名称:mwenhanced,代码行数:23,代码来源:firebird.php

示例7: _fetch_object

 /**
  * Result - object
  *
  * Returns the result set as an object
  *
  * @return	object
  */
 protected function _fetch_object()
 {
     if (($row = @ibase_fetch_object($this->result_id, IBASE_FETCH_BLOBS)) !== FALSE) {
         //Increment row count
         $this->num_rows++;
     }
     return $row;
 }
开发者ID:rittidate,项目名称:sbobet-dev,代码行数:15,代码来源:interbase_result.php

示例8: _ibaseFieldFlags

 /**
  * Get the column's flags
  *
  * Supports "primary_key", "unique_key", "not_null", "default",
  * "computed" and "blob".
  *
  * @param string $field_name  the name of the field
  * @param string $table_name  the name of the table
  *
  * @return string  the flags
  *
  * @access private
  */
 function _ibaseFieldFlags($field_name, $table_name)
 {
     $sql = 'SELECT R.RDB$CONSTRAINT_TYPE CTYPE' . ' FROM RDB$INDEX_SEGMENTS I' . '  JOIN RDB$RELATION_CONSTRAINTS R ON I.RDB$INDEX_NAME=R.RDB$INDEX_NAME' . ' WHERE I.RDB$FIELD_NAME=\'' . $field_name . '\'' . '  AND UPPER(R.RDB$RELATION_NAME)=\'' . strtoupper($table_name) . '\'';
     $result = @ibase_query($this->connection, $sql);
     if (!$result) {
         return $this->ibaseRaiseError();
     }
     $flags = '';
     if ($obj = @ibase_fetch_object($result)) {
         @ibase_free_result($result);
         if (isset($obj->CTYPE) && trim($obj->CTYPE) == 'PRIMARY KEY') {
             $flags .= 'primary_key ';
         }
         if (isset($obj->CTYPE) && trim($obj->CTYPE) == 'UNIQUE') {
             $flags .= 'unique_key ';
         }
     }
     $sql = 'SELECT R.RDB$NULL_FLAG AS NFLAG,' . '  R.RDB$DEFAULT_SOURCE AS DSOURCE,' . '  F.RDB$FIELD_TYPE AS FTYPE,' . '  F.RDB$COMPUTED_SOURCE AS CSOURCE' . ' FROM RDB$RELATION_FIELDS R ' . '  JOIN RDB$FIELDS F ON R.RDB$FIELD_SOURCE=F.RDB$FIELD_NAME' . ' WHERE UPPER(R.RDB$RELATION_NAME)=\'' . strtoupper($table_name) . '\'' . '  AND R.RDB$FIELD_NAME=\'' . $field_name . '\'';
     $result = @ibase_query($this->connection, $sql);
     if (!$result) {
         return $this->ibaseRaiseError();
     }
     if ($obj = @ibase_fetch_object($result)) {
         @ibase_free_result($result);
         if (isset($obj->NFLAG)) {
             $flags .= 'not_null ';
         }
         if (isset($obj->DSOURCE)) {
             $flags .= 'default ';
         }
         if (isset($obj->CSOURCE)) {
             $flags .= 'computed ';
         }
         if (isset($obj->FTYPE) && $obj->FTYPE == 261) {
             $flags .= 'blob ';
         }
     }
     return trim($flags);
 }
开发者ID:ryo88c,项目名称:BEAR.Saturday,代码行数:52,代码来源:ibase.php

示例9: num_rows

 function num_rows($query)
 {
     if ($this->debug) {
         echo "<pre style=\"color : green\">Getting number of rows {$this->dbpath} <p style=\"color:purple;\"> {$query} </p></pre>";
     }
     $noofrows = 0;
     //Validate the sql statement and make adjustments
     switch ($this->dbtype) {
         /* Firebird Functionality */
         case "firebird":
             //write some things here
             $icount = 0;
             while ($row = ibase_fetch_object($query)) {
                 $icount++;
             }
             $noofrows = $icount;
             break;
             /* SQLite Functionality */
         /* SQLite Functionality */
         case "sqlite":
             putenv("TMP=" . $this->tmppath);
             $noofrows = sqlite_num_rows($query);
             break;
             /*DBASE functionality */
         /*DBASE functionality */
         case "dbase":
             $noofrows = dbase_numrecords($this->dbh);
             break;
             /* MYSQL Functionality */
         /* MYSQL Functionality */
         case "mysql":
             $noofrows = mysql_num_rows($query);
             break;
             /* Oracle Functionality */
         /* Oracle Functionality */
         case "oracle":
             $noofrows = oci_num_rows($query);
             break;
             /* PGSQL Functionality */
         /* PGSQL Functionality */
         case "pgsql":
             $noofrows = pg_num_rows($query);
             break;
     }
     if ($this->debug) {
         echo "<pre style=\"color : blue\">Number of rows {$noofrows} \n </pre>";
     }
     return $noofrows;
 }
开发者ID:mortalerror,项目名称:ultimatesims,代码行数:49,代码来源:cdeclass.php

示例10: getFields

    /**
    +----------------------------------------------------------
    * 取得数据表的字段信息
    +----------------------------------------------------------
    * @access public
    +----------------------------------------------------------
    * @throws ThinkExecption
    +----------------------------------------------------------
    */
    public function getFields($tableName)
    {
        $result = $this->query('SELECT RDB$FIELD_NAME AS FIELD, RDB$DEFAULT_VALUE AS DEFAULT1, RDB$NULL_FLAG AS NULL1 FROM RDB$RELATION_FIELDS WHERE RDB$RELATION_NAME=UPPER(\'' . $tableName . '\') ORDER By RDB$FIELD_POSITION');
        $info = array();
        if ($result) {
            foreach ($result as $key => $val) {
                $info[trim($val['FIELD'])] = array('name' => trim($val['FIELD']), 'type' => '', 'notnull' => (bool) ($val['NULL1'] == 1), 'default' => $val['DEFAULT1'], 'primary' => false, 'autoinc' => false);
            }
        }
        //剑雷 取表字段类型
        $sql = 'select first 1 * from ' . $tableName;
        $rs_temp = ibase_query($this->_linkID, $sql);
        $fieldCount = ibase_num_fields($rs_temp);
        for ($i = 0; $i < $fieldCount; $i++) {
            $col_info = ibase_field_info($rs_temp, $i);
            $info[trim($col_info['name'])]['type'] = $col_info['type'];
        }
        ibase_free_result($rs_temp);
        //剑雷 取表的主键
        $sql = 'select b.rdb$field_name as FIELD_NAME from rdb$relation_constraints a join rdb$index_segments b
on a.rdb$index_name=b.rdb$index_name
where a.rdb$constraint_type=\'PRIMARY KEY\' and a.rdb$relation_name=UPPER(\'' . $tableName . '\')';
        $rs_temp = ibase_query($this->_linkID, $sql);
        while ($row = ibase_fetch_object($rs_temp)) {
            $info[trim($row->FIELD_NAME)]['primary'] = True;
        }
        ibase_free_result($rs_temp);
        return $info;
    }
开发者ID:dalinhuang,项目名称:concourse,代码行数:38,代码来源:DbIbase.class.php

示例11: _fetch_object

 /**
  * Result - object
  *
  * Returns the result set as an object
  *
  * @param	string	$class_name
  * @return	object
  */
 protected function _fetch_object($class_name = 'stdClass')
 {
     $row = ibase_fetch_object($this->result_id, IBASE_FETCH_BLOBS);
     if ($class_name === 'stdClass' or !$row) {
         return $row;
     }
     $class_name = new $class_name();
     foreach ($row as $key => $value) {
         $class_name->{$key} = $value;
     }
     return $class_name;
 }
开发者ID:sacsand,项目名称:abcd,代码行数:20,代码来源:ibase_result.php

示例12: _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;
 }
开发者ID:hottaro,项目名称:xpressengine,代码行数:101,代码来源:DBFirebird.class.php

示例13: array

<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
$dados = array('nome' => '', 'email' => '', 'senha' => '');
if ('post' == strtolower($_SERVER['REQUEST_METHOD'])) {
    $dados = array('nome' => filter_var($_POST['nome'], FILTER_SANITIZE_STRING), 'email' => filter_var($_POST['email'], FILTER_SANITIZE_EMAIL), 'senha' => empty($_POST['senha']) ? $usuario_logado->SENHA : sha1(md5($_POST['senha'])));
    $sql = "INSERT INTO usuarios(id, nome, email, senha) VALUES ((SELECT iif(MAX(id) > 0, MAX(id), 0) FROM usuarios) + 1, '{$dados['nome']}', '{$dados['email']}', '{$dados['senha']}') RETURNING id";
    if ($rotas['id']) {
        $sql = "UPDATE usuarios  SET nome = '{$dados['nome']}', email = '{$dados['email']}', senha = '{$dados['senha']}' WHERE id = '{$usuario_logado->ID}' RETURNING id";
    }
    $query = ibase_query($conexao, $sql);
    $resultado = ibase_fetch_object($query);
    if ($resultado) {
        header("Location: {$base}/index.php/{$rotas['pagina']}/formulario/{$resultado->ID}");
    }
    echo 'Houve um erro ao salvar os dados. Tente novamente.<br/>' . ibase_errmsg();
}
if ($rotas['id']) {
    $sql = "SELECT * FROM usuarios WHERE id = '{$rotas['id']}'";
    $query = ibase_query($conexao, $sql);
    $dados = ibase_fetch_assoc($query);
    $dados = array_change_key_case($dados, CASE_LOWER);
}
?>
<h2><?php 
echo $rotas['id'] ? 'Editar' : 'Criar novo';
?>
开发者ID:EveraldoReis,项目名称:postgre-cms,代码行数:31,代码来源:formulario.php

示例14: while

    ?>
 value="<?php 
    echo $usuario->ID;
    ?>
"><?php 
    echo $usuario->NOME;
    ?>
</option>
        <?php 
}
?>
    </select><br/><br/>
    <label>Página</label><br/>
    <select required name="pagina_id">
        <?php 
while ($pagina = ibase_fetch_object($paginas)) {
    ?>
            <option <?php 
    echo $dados['pagina_id'] == $pagina->ID ? 'selected' : null;
    ?>
 value="<?php 
    echo $pagina->ID;
    ?>
"><?php 
    echo $pagina->NOME;
    ?>
</option>
        <?php 
}
?>
    </select><br/><br/>
开发者ID:EveraldoReis,项目名称:postgre-cms,代码行数:31,代码来源:formulario.php

示例15: while

                        <td align="left" valign="top" class="form_header">Units</td>
                        <td align="left" valign="top" class="form_header">Price</td>
                        <td align="left" valign="top" class="form_header">Cost</td>
                        <td align="left" valign="top" class="form_header">Units</td>
                        <td align="left" valign="top" class="form_header">Price</td>
                        <td align="left" valign="top" class="form_header">Amount</td>
                        <td align="left" valign="top" class="form_header">Units</td>
                        <td align="left" valign="top" class="form_header">Nav</td>
                    </tr>
                    <?php 
$salestotals = 0;
$purchasetotals = 0;
$Tpurchaseunits = 0;
$Tsoldunits = 0;
$balance_units = 0;
while ($trans = ibase_fetch_object($querytrans)) {
    echo "<tr valign=TOP onMouseOver=bgColor=&#39;yellow&#39; onMouseOut=bgColor=&#39;White&#39; bgcolor=White> ";
    $trans_id = $trans->TRANS_ID;
    $trans_date = date("d-m-Y", strtotime($trans->TRANS_DATE));
    $transtype = $trans->TRANS_TYPE;
    if ($transtype == "PURCHASE") {
        $unitspurchased = $trans->NOOFSHARES;
        $purchaseprice = $trans->PRICE;
        $purchasecost = $trans->AMOUNT;
        $unitssold = "--";
        $saleprice = "--";
        $salesamount = "--";
        $Tpurchaseunits = $Tpurchaseunits + $unitspurchased;
        $purchasetotals = $purchasetotals + $purchasecost;
    } elseif ($transtype == "WITHDRAWAL") {
        $unitspurchased = "--";
开发者ID:Kemallyson,项目名称:Wizglobal,代码行数:31,代码来源:test.php


注:本文中的ibase_fetch_object函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。