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


PHP cubrid_fetch_array函数代码示例

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


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

示例1: field_data

 function field_data()
 {
     $retval = array();
     $tablePrimaryKeys = array();
     while ($field = cubrid_fetch_field($this->result_id)) {
         $F = new stdClass();
         $F->name = $field->name;
         $F->type = $field->type;
         $F->default = $field->def;
         $F->max_length = $field->max_length;
         $res = cubrid_query($this->conn_id, "SELECT COUNT(*) FROM db_index WHERE class_name = '" . $field->table . "' AND is_primary_key = 'YES' AND index_name = 'pk_" . $field->table . "_" . $field->name . "'");
         if ($res) {
             $row = cubrid_fetch_array($res, CUBRID_NUM);
             $F->primary_key = $row[0] > 0 ? 1 : null;
         } else {
             $F->primary_key = null;
         }
         if (is_resource($res)) {
             cubrid_close_request($res);
             $this->result_id = FALSE;
         }
         $retval[] = $F;
     }
     return $retval;
 }
开发者ID:pepegarcia,项目名称:publicidadoficialdemo-1,代码行数:25,代码来源:cubrid_result.php

示例2: field_data

 /**
  * Field data
  *
  * Generates an array of objects containing field meta-data
  *
  * @access public
  * @return array
  */
 function field_data()
 {
     $retval = array();
     $tablePrimaryKeys = array();
     while ($field = cubrid_fetch_field($this->result_id)) {
         $F = new stdClass();
         $F->name = $field->name;
         $F->type = $field->type;
         $F->default = $field->def;
         $F->max_length = $field->max_length;
         // At this moment primary_key property is not returned when
         // cubrid_fetch_field is called. The following code will
         // provide a patch for it. primary_key property will be added
         // in the next release.
         // TODO: later version of CUBRID will provide primary_key
         // property.
         // When PK is defined in CUBRID, an index is automatically
         // created in the db_index system table in the form of
         // pk_tblname_fieldname. So the following will count how many
         // columns are there which satisfy this format.
         // The query will search for exact single columns, thus
         // compound PK is not supported.
         $res = cubrid_query($this->conn_id, "SELECT COUNT(*) FROM db_index WHERE class_name = '" . $field->table . "' AND is_primary_key = 'YES' AND index_name = 'pk_" . $field->table . "_" . $field->name . "'");
         if ($res) {
             $row = cubrid_fetch_array($res, CUBRID_NUM);
             $F->primary_key = $row[0] > 0 ? 1 : null;
         } else {
             $F->primary_key = null;
         }
         if (is_resource($res)) {
             cubrid_close_request($res);
             $this->result_id = FALSE;
         }
         $retval[] = $F;
     }
     return $retval;
 }
开发者ID:quanict,项目名称:giaF,代码行数:45,代码来源:cubrid_result.php

示例3: fetchArray

 public function fetchArray()
 {
     if (!empty($this->query)) {
         return cubrid_fetch_array($this->query);
     } else {
         return false;
     }
 }
开发者ID:bytemtek,项目名称:znframework,代码行数:8,代码来源:Cubrid.php

示例4: sql_fetch_array

function sql_fetch_array($result, $result_type = CUBRID_BOTH)
{
    $row = cubrid_fetch_array($result, $result_type);
    return $row;
}
开发者ID:BackupTheBerlios,项目名称:idb,代码行数:5,代码来源:cubrid.php


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