當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。