當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ResultSet::close方法代碼示例

本文整理匯總了PHP中ResultSet::close方法的典型用法代碼示例。如果您正苦於以下問題:PHP ResultSet::close方法的具體用法?PHP ResultSet::close怎麽用?PHP ResultSet::close使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ResultSet的用法示例。


在下文中一共展示了ResultSet::close方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getMoreResults

 /**
  * Gets next result set (if this behavior is supported by driver).
  * Some drivers (e.g. MSSQL) support returning multiple result sets -- e.g.
  * from stored procedures.
  *
  * This function also closes any current restult set.
  *
  * Default behavior is for this function to return false.  Driver-specific
  * implementations of this class can override this method if they actually
  * support multiple result sets.
  * 
  * @return boolean True if there is another result set, otherwise false.
  */
 public function getMoreResults()
 {
     if ($this->resultSet) {
         $this->resultSet->close();
     }
     $this->resultSet = null;
     return false;
 }
開發者ID:Daniel-Marynicz,項目名稱:symfony1-legacy,代碼行數:21,代碼來源:StatementCommon.php

示例2: executeUpdate

 /**
  * Executes the SQL INSERT, UPDATE, or DELETE statement in this PreparedStatement object.
  * 
  * @param array $params Parameters that will be set using PreparedStatement::set() before query is executed.
  * @return int Number of affected rows (or 0 for drivers that return nothing).
  * @throws SQLException if a database access error occurs.
  */
 public function executeUpdate($params = null)
 {
     if ($params) {
         for ($i = 0, $cnt = count($params); $i < $cnt; $i++) {
             $this->set($i + 1, $params[$i]);
         }
     }
     if ($this->resultSet) {
         $this->resultSet->close();
     }
     $this->resultSet = null;
     // reset
     $sql = $this->replaceParams();
     $this->updateCount = $this->conn->executeUpdate($sql);
     return $this->updateCount;
 }
開發者ID:BackupTheBerlios,項目名稱:nodin-svn,代碼行數:23,代碼來源:PreparedStatementCommon.php

示例3: executeUpdate

 /**
  * Executes the SQL INSERT, UPDATE, or DELETE statement in this PreparedStatement object.
  * 
  * @param array $params Parameters that will be set using PreparedStatement::set() before query is executed.
  * @return int Number of affected rows (or 0 for drivers that return nothing).
  * @throws SQLException if a database access error occurs.
  */
 public function executeUpdate($params = null)
 {
     foreach ((array) $params as $i => $param) {
         $this->set($i + 1, $param);
         unset($i, $param);
     }
     unset($params);
     if ($this->resultSet) {
         $this->resultSet->close();
     }
     $this->resultSet = null;
     // reset
     $sql = $this->replaceParams();
     $this->updateCount = $this->conn->executeUpdate($sql);
     return $this->updateCount;
 }
開發者ID:Daniel-Marynicz,項目名稱:symfony1-legacy,代碼行數:23,代碼來源:PreparedStatementCommon.php

示例4: fetch_all

 /**
  * Merge ResultSet into RowsAggregate
  *
  * @return RowsAggregate
  */
 protected static function fetch_all(ResultSet $rs, ReflectionClass $class)
 {
     $results = new RowsAggregate();
     while ($rs->next()) {
         $results->add($class->newInstance($rs->getRow()));
     }
     $rs->close();
     return $results;
 }
開發者ID:BackupTheBerlios,項目名稱:medick-svn,代碼行數:14,代碼來源:Base.php


注:本文中的ResultSet::close方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。