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


PHP ibase_field_info函数代码示例

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


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

示例1: FieldName

 function FieldName($Index)
 {
     $FieldInfo = ibase_field_info($this->Records, $Index);
     if ($FieldInfo['alias']) {
         return $FieldInfo['alias'];
     } else {
         return $FieldInfo['name'];
     }
 }
开发者ID:AmesianX,项目名称:pilot,代码行数:9,代码来源:interbase.php

示例2: __construct

 /**
  * Constructor
  *
  * @param   resource handle
  */
 public function __construct($result, TimeZone $tz = NULL)
 {
     $fields = array();
     if (is_resource($result)) {
         for ($i = 0, $num = ibase_num_fields($result); $i < $num; $i++) {
             $field = ibase_field_info($result, $i);
             $fields[$field['name']] = $field['type'];
         }
     }
     parent::__construct($result, $fields, $tz);
 }
开发者ID:melogamepay,项目名称:xp-framework,代码行数:16,代码来源:InterBaseResultSet.class.php

示例3: _performGetBlobFieldNames

 function _performGetBlobFieldNames($result)
 {
     $blobFields = array();
     for ($i = ibase_num_fields($result) - 1; $i >= 0; $i--) {
         $info = ibase_field_info($result, $i);
         if ($info['type'] === "BLOB") {
             $blobFields[] = $info['name'];
         }
     }
     return $blobFields;
 }
开发者ID:saqar,项目名称:tc_aowow,代码行数:11,代码来源:Ibase.php

示例4: field_data

 /**
  * Field data
  *
  * Generates an array of objects containing field meta-data
  *
  * @return    array
  */
 public function field_data()
 {
     $retval = array();
     for ($i = 0, $c = $this->num_fields(); $i < $c; $i++) {
         $info = ibase_field_info($this->result_id, $i);
         $retval[$i] = new stdClass();
         $retval[$i]->name = $info['name'];
         $retval[$i]->type = $info['type'];
         $retval[$i]->max_length = $info['length'];
     }
     return $retval;
 }
开发者ID:at15,项目名称:codeignitordb,代码行数:19,代码来源:ibase_result.php

示例5: 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

示例6: GetFields

 function GetFields()
 {
     $_fields = array();
     $_result = ibase_query($this->_Link, $this->SelectCommand);
     $coln = ibase_num_fields($_result);
     for ($i = 0; $i < $coln; $i++) {
         $_prop = ibase_field_info($_result, $i);
         $_field = array("Name" => $_prop["name"], "Type" => $_prop["type"], "Not_Null" => 0);
         array_push($_fields, $_field);
     }
     ibase_free_result($_result);
     return $_fields;
 }
开发者ID:skydel,项目名称:universal-online-exam,代码行数:13,代码来源:FirebirdDataSource.php

示例7: field_data

 /**
  * Field data
  *
  * Generates an array of objects containing field meta-data
  *
  * @access	public
  * @return	array
  */
 function field_data()
 {
     $retval = array();
     for ($i = 0; $i < $this->num_fields(); $i++) {
         $col_info = ibase_field_info($this->result_id, $i);
         $F = new stdClass();
         $F->name = $col_info['name'];
         $F->type = $col_info['type'];
         $F->max_length = $col_info['length'];
         $F->primary_key = 0;
         $F->default = '';
         $retval[] = $F;
     }
     return $retval;
 }
开发者ID:ibnoe,项目名称:simpatda-thinkfrogs,代码行数:23,代码来源:firebird_result.php

示例8: __construct

 /**
  * This function initializes the class.
  *
  * @access public
  * @override
  * @param DB_Connection_Driver $connection  the connection to be used
  * @param string $sql                       the SQL statement to be queried
  * @param integer $mode                     the execution mode to be used
  * @throws Throwable_SQL_Exception          indicates that the query failed
  */
 public function __construct(DB_Connection_Driver $connection, $sql, $mode = NULL)
 {
     $this->resource = $connection->get_resource();
     $command = @ibase_query($this->resource, $sql);
     if ($command === FALSE) {
         throw new Throwable_SQL_Exception('Message: Failed to query SQL statement. Reason: :reason', array(':reason' => @ibase_errmsg()));
     }
     $this->command = $command;
     $this->record = FALSE;
     $this->blobs = array();
     $count = (int) @ibase_num_fields($command);
     for ($i = 0; $i < $count; $i++) {
         $field = ibase_field_info($command, $i);
         if ($field['type'] == 'BLOB') {
             $this->blobs[] = $field['name'];
         }
     }
 }
开发者ID:ruslankus,项目名称:invoice-crm,代码行数:28,代码来源:Standard.php

示例9: field_data

 /**
  * Field data
  *
  * Generates an array of objects containing field meta-data
  *
  * @access  public
  * @return  array
  */
 function field_data()
 {
     $retval = array();
     $fieldCount = $this->num_fields();
     for ($c = 0; $c < $fieldCount; $c++) {
         $col_info = ibase_field_info($this->stmt_id, $c);
         $F = new stdClass();
         $F->name = $col_info['name'];
         $F->type = $col_info['type'];
         $F->max_length = $col_info['length'];
         $retval[] = $F;
     }
     return $retval;
 }
开发者ID:ibnoe,项目名称:simpatda-thinkfrogs,代码行数:22,代码来源:ibase_result.php

示例10: _execute

 /**
  * Executes a prepared statement.
  *
  * @param array $params OPTIONAL Values to bind to parameter placeholders.
  * @return bool
  * @throws ZendX_Db_Statement_Firebird_Exception
  */
 public function _execute(array $params = null)
 {
     if (!$this->_stmtPrepared) {
         return false;
     }
     // if no params were given as an argument to execute(),
     // then default to the _bindParam array
     if ($params === null) {
         $params = $this->_bindParam;
     }
     // send $params as input parameters to the statement
     if ($params) {
         array_unshift($params, $this->_stmtPrepared);
         $retval = @call_user_func_array('ibase_execute', $params);
     } else {
         // execute the statement
         $retval = @ibase_execute($this->_stmtPrepared);
     }
     $this->_stmtResult = $retval;
     if ($retval === false) {
         $last_error = ibase_errmsg();
         $this->_stmtRowCount = 0;
     }
     //Firebird php ibase extension, auto-commit is not after each call, but at
     //end of script. Disabled when transaction is active
     if (!$this->_adapter->getTransaction()) {
         ibase_commit_ret();
     }
     if ($retval === false) {
         /**
          * @see ZendX_Db_Statement_Firebird_Exception
          */
         require_once 'ZendX/Db/Statement/Firebird/Exception.php';
         throw new ZendX_Db_Statement_Firebird_Exception("Firebird statement execute error : " . $last_error);
     }
     // statements that have no result set do not return metadata
     if (is_resource($this->_stmtResult)) {
         // get the column names that will result
         $this->_keys = array();
         $coln = ibase_num_fields($this->_stmtResult);
         $this->_stmtColumnCount = $coln;
         for ($i = 0; $i < $coln; $i++) {
             $col_info = ibase_field_info($this->_stmtResult, $i);
             $this->_keys[] = $this->_adapter->foldCase($col_info['name']);
         }
         // set up a binding space for result variables
         $this->_values = array_fill(0, count($this->_keys), null);
         // set up references to the result binding space.
         // just passing $this->_values in the call_user_func_array()
         // below won't work, you need references.
         $refs = array();
         foreach ($this->_values as $i => &$f) {
             $refs[$i] =& $f;
         }
     }
     if ($trans = $this->_adapter->getTransaction()) {
         $this->_stmtRowCount = ibase_affected_rows($trans);
     } else {
         $this->_stmtRowCount = ibase_affected_rows($this->_adapter->getConnection());
     }
     return true;
 }
开发者ID:JosefinaArayaTapia,项目名称:Capicua-Restobar,代码行数:69,代码来源:Firebird_3.php

示例11: write_data

 function write_data($table_name)
 {
     global $db;
     $ary_type = $ary_name = array();
     // Grab all of the data from current table.
     $sql = "SELECT *\n\t\t\tFROM {$table_name}";
     $result = $db->sql_query($sql);
     $i_num_fields = ibase_num_fields($result);
     for ($i = 0; $i < $i_num_fields; $i++) {
         $info = ibase_field_info($result, $i);
         $ary_type[$i] = $info['type'];
         $ary_name[$i] = $info['name'];
     }
     while ($row = $db->sql_fetchrow($result)) {
         $schema_vals = $schema_fields = array();
         // Build the SQL statement to recreate the data.
         for ($i = 0; $i < $i_num_fields; $i++) {
             $str_val = $row[strtolower($ary_name[$i])];
             if (preg_match('#char|text|bool|varbinary|blob#i', $ary_type[$i])) {
                 $str_quote = '';
                 $str_empty = "''";
                 $str_val = sanitize_data_generic(str_replace("'", "''", $str_val));
             } else {
                 if (preg_match('#date|timestamp#i', $ary_type[$i])) {
                     if (empty($str_val)) {
                         $str_quote = '';
                     } else {
                         $str_quote = "'";
                     }
                 } else {
                     $str_quote = '';
                     $str_empty = 'NULL';
                 }
             }
             if (empty($str_val) && $str_val !== '0') {
                 $str_val = $str_empty;
             }
             $schema_vals[$i] = $str_quote . $str_val . $str_quote;
             $schema_fields[$i] = '"' . $ary_name[$i] . '"';
         }
         // Take the ordered fields and their associated data and build it
         // into a valid sql statement to recreate that field in the data.
         $sql_data = "INSERT INTO {$table_name} (" . implode(', ', $schema_fields) . ') VALUES (' . implode(', ', $schema_vals) . ");\n";
         $this->flush($sql_data);
     }
     $db->sql_freeresult($result);
 }
开发者ID:eyumay,项目名称:ju.ejhs,代码行数:47,代码来源:acp_database.php

示例12: 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

示例13: resultSet

 /**
  * Enter description here...
  *
  * @param unknown_type $results
  */
 function resultSet(&$results)
 {
     $this->results =& $results;
     $this->map = array();
     $num_fields = ibase_num_fields($results);
     $index = 0;
     $j = 0;
     while ($j < $num_fields) {
         $column = ibase_field_info($results, $j);
         if (!empty($column[2])) {
             $this->map[$index++] = array(ucfirst(strtolower($this->modeltmp[strtolower($column[2])])), strtolower($column[1]));
         } else {
             $this->map[$index++] = array(0, strtolower($column[1]));
         }
         $j++;
     }
 }
开发者ID:rhencke,项目名称:mozilla-cvs-history,代码行数:22,代码来源:dbo_firebird.php

示例14: columns

 public function columns()
 {
     if (empty($this->query)) {
         return false;
     }
     $columns = array();
     $num_fields = $this->numFields();
     $field = '';
     for ($i = 0; $i < $num_fields; $i++) {
         $field = ibase_field_info($this->query, $i);
         $column[] = $field['name'];
     }
     return $columns;
 }
开发者ID:bytemtek,项目名称:znframework,代码行数:14,代码来源:Ibase.php

示例15: ADOFieldObject

 function &FetchField($fieldOffset = -1)
 {
     $fld = new ADOFieldObject();
     $ibf = ibase_field_info($this->_queryID, $fieldOffset);
     switch (ADODB_ASSOC_CASE) {
         case 2:
             // the default
             $fld->name = $ibf['alias'];
             if (empty($fld->name)) {
                 $fld->name = $ibf['name'];
             }
             break;
         case 0:
             $fld->name = strtoupper($ibf['alias']);
             if (empty($fld->name)) {
                 $fld->name = strtoupper($ibf['name']);
             }
             break;
         case 1:
             $fld->name = strtolower($ibf['alias']);
             if (empty($fld->name)) {
                 $fld->name = strtolower($ibf['name']);
             }
             break;
     }
     $fld->type = $ibf['type'];
     $fld->max_length = $ibf['length'];
     /*       This needs to be populated from the metadata */
     $fld->not_null = false;
     $fld->has_default = false;
     $fld->default_value = 'null';
     return $fld;
 }
开发者ID:kractos26,项目名称:orfeo,代码行数:33,代码来源:adodb-ibase.inc.php


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