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


PHP MySQLi::use_result方法代码示例

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


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

示例1: cleanConnection

 protected function cleanConnection()
 {
     while ($this->dbcon->more_results()) {
         $this->dbcon->next_result();
         $res = $this->dbcon->use_result();
         if ($res instanceof mysqli_result) {
             $res->free();
         }
     }
 }
开发者ID:sakibanda,项目名称:ballistic-tracking,代码行数:10,代码来源:TeraWurflDatabase_MySQL5.php

示例2: query

 /**
  * Runs a query and returns a result object
  *  
  * @param string $query
  * @return Application_Model_Queryresult
  */
 public function query($query)
 {
     // If there is no query we can't really do anything
     if (!$query) {
         $this->error = 'No query was requested.';
         return false;
     }
     // If there is no connection handle, get one
     if (!$this->_dbh) {
         $this->_getDbh();
     }
     $return = false;
     // Check again to make sure we are good
     if ($this->_dbh) {
         // Start stacking
         Application_Model_Queryprofiler::setQuery($query);
         // Start the timer
         $start = microtime(true);
         // Handle processing of the result data setting
         //$rs = $this->_dbh->query($query);
         $result = new Application_Model_Queryresult();
         if ($this->_dbh->multi_query($query)) {
             do {
                 if (($rs = $this->_dbh->use_result()) !== false) {
                     $result->setResult($rs);
                     $rs->free();
                 } else {
                     if ($this->_dbh->errno) {
                         // there was an error
                         $this->error .= ' ' . $this->_dbh->error;
                     }
                 }
             } while ($this->_dbh->more_results() && $this->_dbh->next_result());
         } else {
             if (($rs = $this->_dbh->query($query)) !== false) {
                 $result->setResult($rs);
                 $rs->free();
             } else {
                 if ($this->_dbh->errno) {
                     $this->error = $this->_dbh->error;
                 }
             }
         }
         // Stop the time
         $stop = microtime(true);
         // Handle errors
         //if ($this->_dbh->error) {
         //	$this->error = $this->_dbh->error;
         //}
         // Handle timer
         $totaltime = $stop - $start;
         Application_Model_Queryprofiler::setQueryTime($totaltime);
         Application_Model_Queryprofiler::setQueryError($this->error);
         // Set the result sets, record sets and statistics
         $result->setResultStats();
         //$return = $rs;
         $return = $result;
     } else {
         $this->error = 'There is no database connector.';
     }
     return $return;
 }
开发者ID:fniftaly,项目名称:Java-Selenium,代码行数:68,代码来源:Abstract.php


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