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


PHP DBConnect::connect方法代碼示例

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


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

示例1: DBConnect

 function __construct()
 {
     require_once 'DB_Connect.php';
     // connecting to database
     $db = new DBConnect();
     $this->conn = $db->connect();
 }
開發者ID:depp1993,項目名稱:LoginApplicationTest,代碼行數:7,代碼來源:DB_Functions.php

示例2: checkLogin

 public function checkLogin($user, $pw)
 {
     $db = new DBConnect();
     $mysql = $db->connect();
     $sql = "SELECT * FROM user WHERE nickname = '" . $user . "' AND pw = '" . sha1($pw) . "'";
     $result = $mysql->query($sql);
     if ($mysql->affected_rows == 1) {
         $row = $result->fetch_assoc();
         $_SESSION['nickname'] = $row['nickname'];
         $_SESSION['firstname'] = $row['firstname'];
         $_SESSION['lastname'] = $row['lastname'];
         $_SESSION['email'] = $row['email'];
         $_SESSION['loggedin'] = true;
         $db->close();
         return true;
     }
     $db->close();
     return false;
 }
開發者ID:nxnc,項目名稱:WPF_MW,代碼行數:19,代碼來源:login.php

示例3: DBConnect

<?php

require_once '../db.php';
$db = new DBConnect();
$con = $db->connect();
if (!is_null($con)) {
    $rawdata = file_get_contents('php://input');
    $obj = json_decode($rawdata);
    if (isset($obj->id_payment)) {
        $query = sprintf("delete from payment where id = '%s'", $con->real_escape_string($obj->id_payment));
        $result = $con->query($query);
        if ($result) {
            header("HTTP/1.1 200 OK");
        } else {
            header("HTTP/1.1 500 Internal Server Error");
        }
    } else {
        header("HTTP/1.1 500 Internal Server Error");
    }
} else {
    header("HTTP/1.1 500 Internal Server Error");
}
開發者ID:CreactivisArg,項目名稱:sistema,代碼行數:22,代碼來源:deletePayment.php

示例4: __construct

 function __construct()
 {
     $data = array('host' => 'localhost', 'db' => 'test', 'user' => 'root', 'pwd' => '');
     $this->_c = DBConnect::connect($data);
 }
開發者ID:Dmytriiev,項目名稱:custom,代碼行數:5,代碼來源:a_model.php

示例5: DBConnect

 public static final function _Connect(){
     $db = new DBConnect();
     $db->connect(self::PUBLIC_SERVER, self::PUBLIC_ENTRY, self::PUBLIC_PASS, self::PUBLIC_DATABASE);
     return $db;
 }
開發者ID:rexfleischer,項目名稱:web_dev,代碼行數:5,代碼來源:_database.php

示例6: DBConnect

<?php

// 데이터베이스에 레코드를 수정하는 페이지
include "dbConnect.php";
error_reporting(E_ALL);
ini_set("display_errors", 1);
$subject = $_POST["subject"];
// POST 변수로 제목 변수 받아옴
$content = $_POST["content"];
// POST 변수로 내용 변수 받아옴
$num = $_POST["num"];
// POST 변수로 번호 변수 받아옴
$ip = $_SERVER["REMOTE_ADDR"];
// 클라이언트 IP 받아옴
$db = new DBConnect();
$db->connect();
$query = "update dictionary set subject = '{$subject}', content = '{$content}', ip = '{$ip}', regdate = now() where num = {$num};";
// DB에서 레코드를 수정하기 위한 쿼리문
mysql_query($query);
// 쿼리문 실행
$db->disconnect();
開發者ID:acholyte,項目名稱:ITNote,代碼行數:21,代碼來源:update.php

示例7: GetDefaultConnection

 /**
  *
  * @global DBConnect $__conn
  * @return DBConnect
  */
 public static function GetDefaultConnection()
 {
     static $__conn;
     require_once FCORE_FILE_DBCONNECT;
     if ($__conn == null)
     {
         $__conn = new DBConnect(self::$GLOBAL_LOGGER);
     }
     if (!$__conn->isConnected())
     {
         $__conn->connect(self::$DB_DEFAULT_HOST,
                 self::$DB_DEFAULT_USER,
                 self::$DB_DEFAULT_PASS,
                 self::$DB_DEFAULT_DB);
     }
     return $__conn;
 }
開發者ID:rexfleischer,項目名稱:web_dev,代碼行數:22,代碼來源:FCore.php


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