Db::close PHP Method

close() public method

关闭数据库
public close ( )
    public function close()
    {
        // if (!empty($this->queryID)) {
        //     mysql_free_result($this->queryID);
        // }
        // if ($this->_linkID && !mysql_close($this->_linkID)) {
        //     throw_exception($this->error());
        // }
        $this->_linkID = 0;
    }

Usage Example

Example #1
0
 /**
  * 回滚所有全局事务。同时关闭全局事务选项.
  * @param string $dbname
  */
 static function rollback($dbname = null)
 {
     if ($dbname) {
         if (isset(Db::$txDbs[$dbname])) {
             $db = Db::$txDbs[$dbname];
             $db->rollback();
             unset(TxScope::$txDbs[$dbname]);
             unset(Db::$txDbs[$dbname]);
         }
     } else {
         Db::close();
         self::$tx = false;
     }
 }
All Usage Examples Of Db::close