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


PHP mysqli_result::free方法代码示例

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


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

示例1: __destruct

 public function __destruct()
 {
     if (is_object($this->handle)) {
         $this->handle->free();
     }
     // Don't close statement as these may be re-used across the life of this request
     // if (is_object($this->statement)) $this->statement->close();
 }
开发者ID:congaaids,项目名称:silverstripe-framework,代码行数:8,代码来源:MySQLQuery.php

示例2: unset

 public function &free()
 {
     if ($this->m_error instanceof ZDatabaseQueryError) {
         unset($this->m_error);
     }
     $this->m_error = null;
     if ($this->m_result instanceof mysqli_result) {
         $this->m_result->free();
     }
     return $this;
 }
开发者ID:BGCX261,项目名称:zoombi-svn-to-git,代码行数:11,代码来源:mysqlidatabaseadapter.php

示例3: fetch

 /**
  * @param mysqli_result $mysqli_result
  * @param bool $single
  * @return array|bool|null
  */
 public function fetch($mysqli_result, $single)
 {
     $this->_('fields', array());
     foreach ($mysqli_result->fetch_fields() as $field) {
         $this->_('fields')[$field->name] = $this->rules[$this->types[$field->type]];
     }
     switch (true) {
         case !$mysqli_result:
             return null;
         case $single && $mysqli_result->num_rows == 0:
             $result = false;
             break;
         case $single:
             $result = $this->cast($mysqli_result->fetch_assoc());
             break;
         case $mysqli_result->num_rows == 0:
             $result = array();
             break;
         default:
             $result = array();
             while ($row = $mysqli_result->fetch_assoc()) {
                 $result[] = $this->cast($row);
             }
     }
     $mysqli_result->free();
     return $result;
 }
开发者ID:enderteszla,项目名称:phpframework-etc,代码行数:32,代码来源:Result.php

示例4: bind

 /**
  * Binds this statement to the variables
  */
 protected function bind()
 {
     $variables = array();
     // Bind each field
     while ($field = $this->metadata->fetch_field()) {
         $this->columns[] = $field->name;
         // Note that while boundValues isn't initialised at this point,
         // later calls to $this->statement->fetch() Will populate
         // $this->boundValues later with the next result.
         $variables[] =& $this->boundValues[$field->name];
     }
     call_user_func_array(array($this->statement, 'bind_result'), $variables);
     $this->bound = true;
     $this->metadata->free();
     // Buffer all results
     $this->statement->store_result();
 }
开发者ID:nicocin,项目名称:silverstripe-framework,代码行数:20,代码来源:MySQLStatement.php

示例5: current

 /**
  * @see \Iterator::current()
  *
  * @return mixed
  * @throws \OutOfRangeException
  */
 public function current()
 {
     // Seems overkill to define our own OutOfRangeException. Use default in this case
     if ($this->_pointer > $this->_numberOfRows - 1) {
         throw new \OutOfRangeException('Attempting to access a row that is outside of the number of rows in this result.');
     }
     $pointer = $this->_pointer;
     if (!array_key_exists($this->_pointer, $this->_mysqlResult)) {
         $this->_mysqlResult[$this->_pointer] = $this->_result->fetch_array(\MYSQLI_ASSOC);
         $this->_pointer++;
         $this->_moveToNextRow = true;
         $this->_processedRows++;
         // Free up results when there is no more row to process
         if ($this->_processedRows === $this->_numberOfRows) {
             $this->_result->free();
         }
     }
     return $this->_mysqlResult[$pointer];
 }
开发者ID:jayzeng,项目名称:dao,代码行数:25,代码来源:Result.php

示例6: close

 /**
  * 
  * 关闭 stmt result mysqli的函数,传入这三个东西就行
  * @param mysqli,stmt,result
  */
 static function close(mysqli $mysqli = null, mysqli_stmt $stmt = null, mysqli_result $result = null)
 {
     if ($result != null) {
         $result->free();
     }
     if ($stmt != null) {
         $stmt->close();
     }
     if ($mysqli != null) {
         $mysqli->close();
     }
 }
开发者ID:reducm,项目名称:JASEnglish,代码行数:17,代码来源:db.class.php

示例7: free

 /**
  * 释放资源
  */
 public function free()
 {
     if ($this->result) {
         $this->result->free();
         $mysql = $this->mysql->connect();
         while ($mysql->more_results() && $mysql->next_result()) {
             $result = $mysql->store_result();
             if ($result) {
                 $result->free();
             }
         }
     }
 }
开发者ID:qazzhoubin,项目名称:emptyphp,代码行数:16,代码来源:Result.php

示例8: fetchResource

 /**
  * @param \mysqli_result $resource
  * @param string         $column
  *
  * @return mixed[]
  */
 protected function fetchResource($resource, $column)
 {
     $fields = $resource->fetch_fields();
     if (count($fields) == 0) {
         return [];
     }
     $result = $resource->fetch_all(MYSQLI_ASSOC);
     if (!is_array($result)) {
         return [];
     }
     $resource->free();
     $this->fixTypes($result, $fields, $column);
     return $result;
 }
开发者ID:binsoul,项目名称:db-platform-mysql,代码行数:20,代码来源:QueryResult.php

示例9: free

 /**
  * free mysql resource
  *
  * @param \mysqli_result $res
  *
  * @throws DatabaseException|\Exception
  * @return bool
  */
 public function free($res)
 {
     $res->free();
     return true;
 }
开发者ID:chilimatic,项目名称:database-component,代码行数:13,代码来源:MySQL.php

示例10: __destruct

 public function __destruct()
 {
     $this->result->free();
 }
开发者ID:laiello,项目名称:pkgmanager,代码行数:4,代码来源:mysqli_result.class.php

示例11: free

 /**
  * 释放所有与上次查询结果所关联的内存
  * @return bool
  */
 public function free()
 {
     return $this->result->free();
 }
开发者ID:wan-qy,项目名称:Tieba-Cloud-Sign,代码行数:8,代码来源:class.mysqli.php

示例12: __destruct

 /**
  * @inheritdoc
  */
 public function __destruct()
 {
     if (is_object($this->result)) {
         $this->result->free();
     }
 }
开发者ID:miknatr,项目名称:dbster,代码行数:9,代码来源:AdapterMysqliResult.php

示例13: _free

 /**
  * 释放sql查询结果
  *
  * @param \mysqli_result $res 要释放的结果
  * @return bool 成功返回true,失败返回false
  */
 protected function _free($res)
 {
     return $res->free();
 }
开发者ID:snje1987,项目名称:minifw,代码行数:10,代码来源:Mysqli.php

示例14: getRowsArray

 /**
  * Get all rows from the DB result.
  *
  * @param \mysqli_result|bool $result The return of query method.
  *
  * @return array The array of SQL rows
  */
 public function getRowsArray($result)
 {
     $rows = [];
     if (!$result) {
         return $rows;
     }
     while ($row = $result->fetch_assoc()) {
         $rows[] = $row;
     }
     $result->free();
     return $rows;
 }
开发者ID:rzajac,项目名称:schema,代码行数:19,代码来源:MySQL.php

示例15: free

 /**
  * Free the result
  */
 public function free()
 {
     if (is_object($this->resResult)) {
         $this->resResult->free();
     }
 }
开发者ID:bytehead,项目名称:contao-core,代码行数:9,代码来源:Result.php


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