本文整理汇总了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();
}
示例2: getCoon
public static function getCoon()
{
static $conn = NULL;
if ($conn == NULL) {
$conn = new DBConnect();
}
return $conn->getCoon();
}
示例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;
}
示例4: getInstance
public static function getInstance()
{
if (is_null(self::$instance)) {
self::$instance = new DBConnect();
}
return self::$instance;
}
示例5: getInstance
public static function getInstance()
{
if (!isset(DBConnect::$db)) {
DBConnect::$db = new DBConnect();
}
return DBConnect::$db->dbh;
}
示例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);
}
示例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);
}
示例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'];
}
示例9: getRedisServer
public static function getRedisServer()
{
if (null === self::$_instance) {
self::$_instance = new Redis();
self::$_instance->connect(DBConnectConfig::HOST, DBConnectConfig::PORT);
}
return self::$_instance;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}