当前位置: 首页>>代码示例>>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;未经允许,请勿转载。