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