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