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


PHP DB::close方法代碼示例

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


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

示例1: yg_shutdown

function yg_shutdown()
{
    DB::close();
    fire_hook('shutdown');
}
開發者ID:vinerz,項目名稱:yogo,代碼行數:5,代碼來源:functions.php

示例2: disconnectDB

 /**
  * Close the DB connection.
  */
 protected function disconnectDB()
 {
     if (isset($this->db)) {
         $this->db->close();
         $this->db = null;
     }
 }
開發者ID:sachsy,項目名稱:DB-MySQL,代碼行數:10,代碼來源:DBTest.php

示例3: __shutdown

/**
 * Feng Office shutdown function
 *
 * @param void
 * @return null
 */
function __shutdown() {
	DB::close();
	$logger_session = Logger::getSession();
	if(($logger_session instanceof Logger_Session) && !$logger_session->isEmpty()) {
		Logger::saveSession();
	} // if
} // __shutdown
開發者ID:Jtgadbois,項目名稱:Pedadida,代碼行數:13,代碼來源:functions.php

示例4: query

 /**
  * Make a sql query to the database.
  *
  * @param string $sql
  * @return integer
  */
 public static function query($sql)
 {
     DB::connect();
     $res = mysqli_query(DB::$connection, $sql);
     DB::close();
     return $res;
 }
開發者ID:DRONESTUDIO,項目名稱:fudit,代碼行數:13,代碼來源:DB.php

示例5: close

 /**
  * Close the session
  * @return bool
  */
 function close()
 {
     $this->gc();
     DB::close();
     //close database-connection
     return true;
 }
開發者ID:duynhan07,項目名稱:elink,代碼行數:11,代碼來源:session.class.php

示例6: __destruct

 /**
  * 銷毀
  */
 public function __destruct()
 {
     global $_M;
     DB::close();
     //關閉數據庫連接
     exit;
 }
開發者ID:nanfs,項目名稱:lt,代碼行數:10,代碼來源:ajax.class.php

示例7: run

 function run()
 {
     DB::connect();
     //determin controller
     switch ($_GET['ctrl']) {
         case 'page':
             $ctrl = new PageController();
             break;
         case 'wine':
             $ctrl = new WineController();
             break;
         case 'response':
             $ctrl = new ResponseController();
             break;
         case 'report':
             $ctrl = new ReportController();
             break;
         case 'dp':
             $ctrl = new DianPingController();
             break;
         default:
             $ctrl = new PageController();
     }
     return $ctrl->dispatch($_GET['action'] . "Action");
     DB::close();
 }
開發者ID:innomative,項目名稱:16degrees,代碼行數:26,代碼來源:bootstrap.php

示例8: sendError

 public static function sendError($error = 1)
 {
     header('HTTP/1.1 500 Internal Server Error');
     //header('Content-Type: application/json; charset=UTF-8');
     DB::close();
     User::destroySession();
     exit(self::encodeError($error));
 }
開發者ID:jDek-Mikhail,項目名稱:proverid,代碼行數:8,代碼來源:ajax.php

示例9: end

 public function end()
 {
     if ($this->isAlreadyOpened === TRUE) {
         $this->endTransaction();
         $this->DB->close();
     }
     unset($this->DB);
     $this->isAlreadyOpened = FALSE;
 }
開發者ID:caranaperu,項目名稱:atletismo,代碼行數:9,代碼來源:TSLTransactionManager.php

示例10: newUser

 private function newUser()
 {
     $db = new DB();
     $query = 'INSERT INTO mototimes_users (id_vk, name, role) VALUES(?,"new user","standart")';
     $stmt = $db->prepare($query);
     $stmt->bind_param('i', $this->get('userid'));
     $stmt->execute();
     $db->close();
 }
開發者ID:rjhdby,項目名稱:MotoTimes.motobat.server,代碼行數:9,代碼來源:Role.class.php

示例11: drawTemplate

 public static function drawTemplate()
 {
     DB::close();
     self::saveContentCurrentBox();
     ob_get_flush();
     if (function_exists('gz_handler')) {
         ob_start("gz_handler");
     }
     include_once './template/' . self::$template . '/template.php';
 }
開發者ID:Kamellot,項目名稱:My-Page,代碼行數:10,代碼來源:Template.php

示例12: execute

 public function execute()
 {
     $db = new DB();
     if ($db->connect_errno) {
         $this->result = ErrorBuilder::dbError($db->connect_error);
         return;
     }
     $query = '
       SELECT
           id,
           UNIX_TIMESTAMP(created) AS created,
           lat,
           lng AS lon,
           karma,
           alignment,
           CASE transport
           WHEN 1 THEN "GS"
           WHEN 2 THEN "RT"
           WHEN 3 THEN "CAR"
           ELSE "GS"
           END AS type,
           `text`
       FROM
           mototimes_events
       WHERE
           UNIX_TIMESTAMP() - UNIX_TIMESTAMP(created) < 14400 + karma*60
           AND transport IN (1,2,3)
       UNION ALL
       SELECT
           id,
           0 AS created,
           lat,
           lon,
           0 AS karma,
           0 AS alignment,
           type,
           `text`
       FROM
           objects
       WHERE `stop` IS NULL OR `stop`>CURRENT_TIMESTAMP()
           ';
     $result = $db->query($query);
     if ($db->errno !== 0) {
         $this->result = ErrorBuilder::dbError($db->error);
         return;
     }
     $list = array();
     while ($row = $result->fetch_assoc()) {
         $list[] = array('id' => (int) $row['id'], 'created' => (int) $row['created'], 'lat' => (double) $row['lat'], 'lon' => (double) $row['lon'], 'karma' => (int) $row['karma'], 'alignment' => (int) $row['alignment'], 'type' => $row['type'], 'text' => $row['text']);
     }
     $db->close();
     $this->result = array("error" => "OK", "data" => $list);
 }
開發者ID:rjhdby,項目名稱:MotoTimes.motobat.server,代碼行數:53,代碼來源:GetList.php

示例13: getFromEnglish

 static function getFromEnglish($english)
 {
     $mysqli = DB::getConn();
     $sql = "select * from english where english='{$english}'";
     $result = DB::getResult($sql, $mysqli);
     $arr = array();
     while ($array = $result->fetch_assoc()) {
         $arr[] = $array;
     }
     DB::close($mysqli, null, $result);
     return $arr;
 }
開發者ID:reducm,項目名稱:JASEnglish,代碼行數:12,代碼來源:JASEnglishDAO.class.php

示例14: vote

function vote()
{
    if (isset($_GET['dir']) && isset($_GET['did'])) {
        $d = new Diff();
        if ($d->populateDiff($_GET['did'])) {
            if ($_GET['dir'] == 1 || $_GET['dir'] == -1) {
                $db = new DB();
                $db->query("SELECT * FROM `rating` WHERE `did` = '{$_GET['did']}' AND `uid` = '{$_SESSION['uid']}';");
                if ($db->numRows() == 0) {
                    $db->query("INSERT INTO `rating` (`did`, `uid`, `rating`) VALUES ('{$_GET['did']}', '{$_SESSION['uid']}', '{$_GET['dir']}');");
                } else {
                    $db->query("UPDATE `rating` SET `rating` = '{$_GET['dir']}' WHERE `did` = '{$_GET['did']}' AND `uid` = '{$_SESSION['uid']}';");
                }
                $db->close();
            }
        }
    }
}
開發者ID:ranok,項目名稱:wiki-wide-web,代碼行數:18,代碼來源:rate.php

示例15: Document

 function Document($row)
 {
     Module::Module($row);
     $cmd = Url::get('cmd');
     require_once "forms/DocumentList.php";
     switch ($cmd) {
         case 'delete':
             $this->add_form(new Deletedocument());
             break;
         case 'change':
             $this->add_form(new PublicdocumentForm());
             break;
         default:
             $id = (int) Url::get('id');
             $azname = trim(URL::get("azname", ''));
             if ($id || $azname != '') {
                 if ($id && $azname != '') {
                     $document = DB::select("document", "id={$id}");
                     if ($document && $azname == AZLib::safe_title($document['title']) && $document['file_path']) {
                         $file_src = DATA_PATH . "document/{$document['file_path']}";
                         if (file_exists(ROOT_PATH . $file_src)) {
                             $ext = AZLib::getExtension($file_src);
                             if ($ext && strlen($ext) <= 5) {
                                 $ext_app = substr($ext, 1);
                                 if ($document['status'] == 1 || User::haveAnyPermission(ADMIN_DOCUMENT)) {
                                     DB::query("UPDATE document SET down_num=down_num+1, time_last=" . TIME_NOW . " WHERE id={$id}");
                                     DB::close();
                                     header("Content-type: application/{$ext_app}");
                                     header("Content-Disposition: attachment; filename=" . date("Y.m.d-H\\hi", $document['time_m']) . "-{$id}-{$azname}{$ext}");
                                     readfile(ROOT_PATH . $file_src);
                                     exit;
                                 }
                             }
                         }
                     }
                 }
                 header("HTTP/1.0 404 Not Found");
                 echo "<h1>404 - Not Found!<br />Return to <a href='" . WEB_ROOT . "'>" . WEB_NAME . "</a></h1>";
                 exit;
             }
             $this->add_form(new ListdocumentForm());
             break;
     }
 }
開發者ID:duynhan07,項目名稱:elink,代碼行數:44,代碼來源:class.php


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