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