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