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


PHP DBConnect類代碼示例

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


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

示例1: __construct

 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: getCoon

 public static function getCoon()
 {
     static $conn = NULL;
     if ($conn == NULL) {
         $conn = new DBConnect();
     }
     return $conn->getCoon();
 }
開發者ID:alonexy,項目名稱:lea,代碼行數:8,代碼來源:DBTool.php

示例3: getTableBody

function getTableBody($tid, $datesCoordination)
{
    $tableBody = '';
    if (isset($tid) == false && isset($datesCoordination) == false) {
        $tableBody .= '<tr><td><input type="datetime-local" class="form-control" oninput="addNewLine()"/></td>';
        $tableBody .= '<td>';
        $tableBody .= '<select class="form-control" required>-';
        $tableBody .= '<option value="0">Ja</option>';
        $tableBody .= '<option value="1">Nein</option>';
        $tableBody .= '<option value="2">Vielleicht</option>';
        $tableBody .= '</select>';
        $tableBody .= '</td>';
        $tableBody .= '<td>';
        $tableBody .= '</td>';
        $tableBody .= '</tr>';
        return $tableBody;
    }
    $dbc = new DBConnect();
    $userVotes = $dbc->loadUsersVotes_db($tid, $_SESSION['userid']);
    if (count($userVotes) > 0) {
        foreach ($userVotes as $vote) {
            $v = $vote->getVote();
            $tableBody .= '<tr><td><input type="datetime-local" class="form-control" readonly value="' . date_format($vote->getDate(), "Y-m-d\\TH:i") . '"/></td>';
            $tableBody .= '<td>';
            $tableBody .= '<select class="form-control" required>-';
            $tableBody .= '<option value="0" ' . ($v == 'Ja' ? 'selected' : '') . '>Ja</option>';
            $tableBody .= '<option value="1" ' . ($v == 'Nein' ? 'selected' : '') . '>Nein</option>';
            $tableBody .= '<option value="2" ' . ($v == 'Vielleicht' ? 'selected' : '') . '>Vielleicht</option>';
            $tableBody .= '</select>';
            $tableBody .= '</td>';
            $tableBody .= '<td>';
            $tableBody .= '</td>';
            $tableBody .= '</tr>';
        }
    } else {
        if (isset($datesCoordination)) {
            $dateVotes = $datesCoordination->getResults();
            foreach ($dateVotes as $vote) {
                $tableBody .= '<tr><td><input type="datetime-local" class="form-control" readonly value="' . date_format($vote->getDate(), "Y-m-d\\TH:i") . '"/></td>';
                $tableBody .= '<td>';
                $tableBody .= '<select class="form-control" required>-';
                $tableBody .= '<option value="0">Ja</option>';
                $tableBody .= '<option value="1">Nein</option>';
                $tableBody .= '<option value="2">Vielleicht</option>';
                $tableBody .= '</select>';
                $tableBody .= '</td>';
                $tableBody .= '<td>';
                $tableBody .= '</td>';
                $tableBody .= '</tr>';
            }
        }
    }
    return $tableBody;
}
開發者ID:Chr1st1anSzech,項目名稱:Terminfindung-Maturitas,代碼行數:54,代碼來源:termin_planen_get.php

示例4: getInstance

 public static function getInstance()
 {
     if (is_null(self::$instance)) {
         self::$instance = new DBConnect();
     }
     return self::$instance;
 }
開發者ID:php2code,項目名稱:School,代碼行數:7,代碼來源:class.dbConnect.php

示例5: getInstance

 public static function getInstance()
 {
     if (!isset(DBConnect::$db)) {
         DBConnect::$db = new DBConnect();
     }
     return DBConnect::$db->dbh;
 }
開發者ID:Mwalima,項目名稱:databank,代碼行數:7,代碼來源:DBConnection.php

示例6: action

 public function action()
 {
     require_once "dbconnect.php";
     // チェックポイント名の取り出し
     // パラメータ取り出し用のクラス作成の予定から変更の可能性あり
     $params = $_GET['point'];
     // データベースコネクションクラスの作成
     $dbConnect = new DBConnect();
     // チェックポイントデータの取り出し
     $pointData = $dbConnect->getPointData($params);
     // 出力用変數への割り當て
     $out['sign'] = $pointData['sign'];
     $out['name'] = $pointData['name'];
     // Skinnyを使用しての値のバインド
     $Skinny->SkinnyDisplay("Check-Point-Temp.html", $out);
 }
開發者ID:pochiMasahiro,項目名稱:NewStampRally,代碼行數:16,代碼來源:dispatch-point.php

示例7: showGemeenteNaam

 public function showGemeenteNaam()
 {
     $db_handle = DBConnect::getInstance();
     $sqlJaar = "SELECT naam FROM Jeugd_Gemeentenaam";
     $stmt = $db_handle->prepare($sqlJaar);
     $stmt->execute();
     $result = $stmt->fetchAll(PDO::FETCH_COLUMN);
 }
開發者ID:Mwalima,項目名稱:databank,代碼行數:8,代碼來源:GemeenteNaam.php

示例8: __construct

 public function __construct($x, $y)
 {
     $db_handle = DBConnect::getInstance();
     $aantalJongeren = new aantalJongeren($db_handle);
     $jaar = $aantalJongeren->showJaren();
     $this->xAx_Points = $jaar;
     $this->yAx_Points = $_POST['PrognoseJongeren'];
 }
開發者ID:Mwalima,項目名稱:databank,代碼行數:8,代碼來源:RegressionTotaalAantalJongerenGemeente.php

示例9: getRedisServer

 public static function getRedisServer()
 {
     if (null === self::$_instance) {
         self::$_instance = new Redis();
         self::$_instance->connect(DBConnectConfig::HOST, DBConnectConfig::PORT);
     }
     return self::$_instance;
 }
開發者ID:JamzyWang,項目名稱:ACKQueue,代碼行數:8,代碼來源:DBConnect.php

示例10: __construct

 public function __construct($x, $y)
 {
     $db_handle = DBConnect::getInstance();
     $aantalJongeren = new aantalJongeren($db_handle);
     $jaar = $aantalJongeren->showJaren();
     $this->xAx_Points = $jaar;
     $totaalnieuweClienten = $aantalJongeren->showAantalNieuweClienten();
     $this->yAx_Points = $totaalnieuweClienten;
 }
開發者ID:Mwalima,項目名稱:databank,代碼行數:9,代碼來源:RegressionNieuweClienten.php

示例11: delMessage

 public function delMessage($imageId)
 {
     $redis = DBConnect::getRedisServer();
     $ret = $redis->lRem(KeyNamespace::FAILED_QUEUE, $imageId, 1);
     if (false == $ret) {
         print "failed to delete message from failed queue\n";
         return false;
     }
     return true;
 }
開發者ID:JamzyWang,項目名稱:ACKQueue,代碼行數:10,代碼來源:DBFailedQueue.php

示例12: 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

示例13: ackMessage

 public static function ackMessage($message)
 {
     $redis = DBConnect::getRedisServer();
     $ret = $redis->lRem(KeyNamespace::UN_ACK_QUEUE, $message, 1);
     if (false == $ret) {
         print "failed to ackMessage\n";
         return false;
     }
     return true;
 }
開發者ID:JamzyWang,項目名稱:ACKQueue,代碼行數:10,代碼來源:DBUnACKQueue.php

示例14: update

 public function update($con_id, $username, $phone, $email)
 {
     $db = DBConnect::getInstance();
     $sql = "UPDATE {$this->table} SET \r\n\t\t\t\t\tusername=:username,\r\n\t\t\t\t\tphone=:phone, \r\n\t\t\t\t\temail=:email \r\n\t\t\t\t\tWHERE id=:con_id";
     $stmt = $db->prepare($sql);
     $stmt->bindValue(':username', $username);
     $stmt->bindValue(':phone', $phone);
     $stmt->bindValue(':email', $email);
     $stmt->bindValue(':con_id', $con_id);
     return $stmt->execute();
 }
開發者ID:nixwins,項目名稱:test_task,代碼行數:11,代碼來源:contact_model.php

示例15: __construct

 public function __construct($x, $y)
 {
     $db_handle = DBConnect::getInstance();
     $jaarJongeren = new aantalJongeren($db_handle);
     $jaar = $jaarJongeren->showJaren();
     //        $laatsteDrieJaren = array_slice($jaar, 2,3);
     $this->xAx_Points = $jaar;
     $aantalJongeren = new JeugdZorgProvincie($db_handle);
     $percentageJongeren = $aantalJongeren->showPercentageNieuweClienten();
     //$percentageLaatsteDrieJaren = array_slice($percentageJongeren, 2,3);
     $this->yAx_Points = $percentageJongeren;
 }
開發者ID:Mwalima,項目名稱:databank,代碼行數:12,代碼來源:RegressionJeugdZorgProvincie.php


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