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


PHP mysqli_result::fetch_field_direct方法代码示例

本文整理汇总了PHP中mysqli_result::fetch_field_direct方法的典型用法代码示例。如果您正苦于以下问题:PHP mysqli_result::fetch_field_direct方法的具体用法?PHP mysqli_result::fetch_field_direct怎么用?PHP mysqli_result::fetch_field_direct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mysqli_result的用法示例。


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

示例1: load_col_info

 /**
  * Load the column metadata from the last query.
  * @return array
  */
 public function load_col_info()
 {
     if ($this->col_info) {
         return $this->col_info;
     }
     $num_fields = $this->result->field_count;
     for ($i = 0; $i < $num_fields; $i++) {
         $this->col_info[$i] = $this->result->fetch_field_direct($i);
     }
     return $this->col_info;
 }
开发者ID:mpeshev,项目名称:wp-db-driver,代码行数:15,代码来源:mysqli.php

示例2: mysqlFieldName

 /**
  * @param mysqli_result $res
  * @param int $n
  * @return string
  */
 protected function mysqlFieldName($res, $n)
 {
     Assert::true($res instanceof mysqli_result, __METHOD__);
     $field = $res->fetch_field_direct($n);
     return $field->name;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:11,代码来源:DatabaseMysqli.php

示例3: getFieldType

 /**
  * Get field type
  *
  * @param mysqli_result $result query result
  * @param int           $offset numerical field index
  *
  * @return string
  */
 public function getFieldType($result, $offset)
 {
     $typecode = $result->fetch_field_direct($offset)->type;
     switch ($typecode) {
         case MYSQLI_TYPE_DECIMAL:
         case MYSQLI_TYPE_NEWDECIMAL:
             $type = 'decimal';
             break;
         case MYSQLI_TYPE_BIT:
             $type = 'bit';
             break;
         case MYSQLI_TYPE_TINY:
         case MYSQLI_TYPE_CHAR:
             $type = 'tinyint';
             break;
         case MYSQLI_TYPE_SHORT:
             $type = 'smallint';
             break;
         case MYSQLI_TYPE_LONG:
             $type = 'int';
             break;
         case MYSQLI_TYPE_FLOAT:
             $type = 'float';
             break;
         case MYSQLI_TYPE_DOUBLE:
             $type = 'double';
             break;
         case MYSQLI_TYPE_NULL:
             $type = 'NULL';
             break;
         case MYSQLI_TYPE_TIMESTAMP:
             $type = 'timestamp';
             break;
         case MYSQLI_TYPE_LONGLONG:
             $type = 'bigint';
             break;
         case MYSQLI_TYPE_INT24:
             $type = 'mediumint';
             break;
         case MYSQLI_TYPE_NEWDATE:
         case MYSQLI_TYPE_DATE:
             $type = 'date';
             break;
         case MYSQLI_TYPE_TIME:
             $type = 'time';
             break;
         case MYSQLI_TYPE_DATETIME:
             $type = 'datetime';
             break;
         case MYSQLI_TYPE_YEAR:
             $type = 'year';
             break;
         case MYSQLI_TYPE_INTERVAL:
             $type = 'interval';
             break;
         case MYSQLI_TYPE_ENUM:
             $type = 'enum';
             break;
         case MYSQLI_TYPE_SET:
             $type = 'set';
             break;
         case MYSQLI_TYPE_TINY_BLOB:
             $type = 'tinyblob';
             break;
         case MYSQLI_TYPE_MEDIUM_BLOB:
             $type = 'mediumblob';
             break;
         case MYSQLI_TYPE_LONG_BLOB:
             $type = 'longblob';
             break;
         case MYSQLI_TYPE_BLOB:
             $type = 'blob';
             break;
         case MYSQLI_TYPE_VAR_STRING:
             $type = 'varchar';
             break;
         case MYSQLI_TYPE_STRING:
             $type = 'char';
             break;
         case MYSQLI_TYPE_GEOMETRY:
             $type = 'geometry';
             break;
         default:
             $type = 'unknown';
             break;
     }
     return $type;
 }
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:96,代码来源:mysqldatabase.php

示例4: dbFieldName

 /**
  * Retrieves returns the field name for a field
  *
  * Returns the field name for a given field number
  *
  * @param    mysqli_result $recordSet   The recordset to operate on
  * @param    int           $fieldNumber field number to return the name of
  * @return   string      Returns name of specified field
  *
  */
 public function dbFieldName($recordSet, $fieldNumber)
 {
     $result = $recordSet->fetch_field_direct($fieldNumber);
     return $result === false ? '' : $result->name;
 }
开发者ID:spacequad,项目名称:glfusion,代码行数:15,代码来源:mysqli.class.php

示例5: fetch_field

 /**
  * Get the column information and return it as array
  *
  * @param integer $intOffset The field offset
  *
  * @return array|object An array or object with the column information
  */
 protected function fetch_field($intOffset)
 {
     return $this->resResult->fetch_field_direct($intOffset);
 }
开发者ID:bytehead,项目名称:contao-core,代码行数:11,代码来源:Result.php


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