close() public method

Closes the cursor and the statement.
public close ( ) : boolean
return boolean
Beispiel #1
0
 /**
  * Prepare a statement and return a PDOStatement-like object.
  *
  * @param  string  $sql  SQL query
  * @return Zend_Db_Statement_Mysqli
  */
 public function prepare($sql)
 {
     $this->_connect();
     if ($this->_stmt) {
         $this->_stmt->close();
     }
     $stmt = new Zend_Db_Statement_Mysqli($this, $sql);
     if ($stmt === false) {
         return false;
     }
     $stmt->setFetchMode($this->_fetchMode);
     $this->_stmt = $stmt;
     return $stmt;
 }
Beispiel #2
0
 /**
  * Prepare a statement and return a PDOStatement-like object.
  *
  * @param  string  $sql  SQL query
  * @return Zend_Db_Statement_Mysqli
  */
 public function prepare($sql)
 {
     $this->_connect();
     if ($this->_stmt) {
         $this->_stmt->close();
     }
     $stmtClass = $this->_defaultStmtClass;
     Zend_Loader::loadClass($stmtClass);
     $stmt = new $stmtClass($this, $sql);
     if ($stmt === false) {
         return false;
     }
     $stmt->setFetchMode($this->_fetchMode);
     $this->_stmt = $stmt;
     return $stmt;
 }
Beispiel #3
0
 /**
  * Prepare a statement and return a PDOStatement-like object.
  *
  * @param  string  $sql  SQL query
  * @return Zend_Db_Statement_Mysqli
  */
 public function prepare($sql)
 {
     $this->_connect();
     if ($this->_stmt) {
         $this->_stmt->close();
     }
     $stmtClass = $this->_defaultStmtClass;
     if (!class_exists($stmtClass)) {
         //require_once 'Zend/Loader.php';
         Zend_Loader::loadClass($stmtClass);
     }
     $stmt = new $stmtClass($this, $sql);
     if ($stmt === false) {
         return false;
     }
     $stmt->setFetchMode($this->_fetchMode);
     $this->_stmt = $stmt;
     return $stmt;
 }