本文整理汇总了PHP中DbConnect::connect方法的典型用法代码示例。如果您正苦于以下问题:PHP DbConnect::connect方法的具体用法?PHP DbConnect::connect怎么用?PHP DbConnect::connect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DbConnect
的用法示例。
在下文中一共展示了DbConnect::connect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
public static function delete($id)
{
$pdo = DbConnect::connect();
$sql = "DELETE from abteilung WHERE id=:id";
$stmt = $pdo->prepare($sql);
$stmt->execute([':id' => $id]);
}
示例2: DbConnect
function __construct()
{
require_once 'dbconn.php';
// CONNESSIONE
$db = new DbConnect();
$this->conn = $db->connect();
}
示例3: DbConnect
function __construct()
{
// opening db connection
$db = new DbConnect();
$this->conn = $db->connect();
//$this->echoAllConstituentNames();
}
示例4: dirname
function __construct()
{
require_once dirname(__FILE__) . '/DbConnect.php';
// Abrimos la conexxion a la BD
$db = new DbConnect();
$this->conn = $db->connect();
}
示例5: array
function __construct()
{
$this->columns = array();
require_once 'config/DbConnect.php';
// opening db connection
$db = new DbConnect();
$this->conn = $db->connect();
}
示例6: dirname
function __construct()
{
require_once dirname(__FILE__) . '/db_connect.php';
require_once dirname(__FILE__) . '/mail/class.phpmailer.php';
require_once dirname(__FILE__) . '/mail/class.smtp.php';
// opening db connection
$db = new DbConnect();
$this->conn = $db->connect();
}
示例7: dirname
function __construct()
{
require_once dirname(__FILE__) . '/DbConnect.php';
//open new database
try {
$db = new DbConnect();
//instantiate the DbConnect class
$this->conn = $db->connect();
} catch (PDOException $ex) {
$this::dbConnectError($ex->getCode());
}
}
示例8: getSubcategory
public function getSubcategory($id)
{
$connection = new DbConnect();
$pdo = $connection->connect();
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$query = "select * from subcategories\n where id = :id";
$stmt = $pdo->prepare($query);
$stmt->bindParam(':id', $id);
$stmt->setFetchMode(PDO::FETCH_CLASS, 'Subcategory');
$stmt->execute();
$subcategory = $stmt->fetch();
return $subcategory;
//return $this;
}
示例9: dirname
function __construct()
{
require_once dirname(__FILE__) . '/DbConnect.php';
//open new database connection
try {
$db = new DbConnect();
//instantiate the DbConnect class
$this->conn = $db->connect();
} catch (Exception $ex) {
$this::dbConnectError($ex->getCode());
exit;
//unconditionally stop processing
}
}
示例10: dirname
function __construct()
{
require_once dirname(__FILE__) . '/DbConnect.php';
// abriendo conexión
$db = new DbConnect();
$this->conn = $db->connect();
session_start();
if (isset($_SESSION['user'])) {
$user_logged_in = true;
}
if (isset($_SESSION['copisteria'])) {
$copisteria_logged_in = true;
}
}
示例11: getAll
public static function getAll()
{
$pdo = DbConnect::connect();
$sql = "SELECT mit.vorname vorname, mit.nachname nachname, abt.name abteilung, CONCAT(vor.vorname, ' ', vor.nachname) vorgesetzter\r\n FROM abteilung abt\r\n LEFT JOIN mitarbeiter mit ON mit.abteilung_id=abt.id\r\n LEFT JOIN mitarbeiter vor ON mit.vorgesetzter_id=vor.id";
$stmt = $pdo->prepare($sql);
$stmt->execute();
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
// echo '<pre>';
// print_r($rows);
// echo '</pre>';
// die();
// echo 'Start';
return $rows;
}
示例12: getAll
public static function getAll()
{
$pdo = DbConnect::connect();
$sql = "SELECT CONCAT(her.name, ' ', a.name, ' ', a.kennzeichen) Fahrzeug, CONCAT(mit.vorname, ' ', mit.nachname) Ausleiher, aus.von Von, aus.bis Bis\r\n FROM auto a, hersteller her, mitarbeiter mit, ausleihe aus\r\n WHERE aus.auto_id=a.id AND a.hersteller_id=her.id AND aus.mitarbeiter_id=mit.id;";
$stmt = $pdo->prepare($sql);
$stmt->execute();
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
// echo '<pre>';
// print_r($rows);
// echo '</pre>';
// die();
// echo 'Start';
return $rows;
}
示例13: getAll
public static function getAll()
{
$pdo = DbConnect::connect();
$sql = "SELECT projekt.name Projektname, CONCAT(mitarbeiter.vorname,' ', mitarbeiter.nachname) Mitarbeiter, HOUR(TIMEDIFF(projektmitarbeiter.von, projektmitarbeiter.bis)) Stunden \r\n FROM projekt, projektmitarbeiter, mitarbeiter \r\n WHERE projektmitarbeiter.projekt_id=projekt.id AND mitarbeiter.id = projektmitarbeiter.mitarbeiter_id;";
$stmt = $pdo->prepare($sql);
$stmt->execute();
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
// echo '<pre>';
// print_r($rows);
// echo '</pre>';
// die();
// echo 'Start';
return $rows;
}
示例14: getAll
public static function getAll()
{
$pdo = DbConnect::connect();
$sql = "SELECT abt.name Abteilung, CONCAT(mit.vorname, ' ', mit.nachname) Ausleiher, aus.von Von, aus.bis Bis\n FROM abteilung abt, mitarbeiter mit, ausleihe aus\n WHERE mit.abteilung_id=abt.id AND aus.mitarbeiter_id=mit.id;";
$stmt = $pdo->prepare($sql);
$stmt->execute();
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
// echo '<pre>';
// print_r($rows);
// echo '</pre>';
// die();
// echo 'Start';
return $rows;
}
示例15: UpdateSubcategoryState
public function UpdateSubcategoryState($subcategoryId, $isOffline)
{
$connection = new DbConnect();
$pdo = $connection->connect();
$query = "UPDATE subcategories\n SET offline = :offline\n WHERE id = :id";
$stmt = $pdo->prepare($query);
$stmt->bindParam(":offline", $isOffline);
$stmt->bindParam(":id", $subcategoryId);
$stmt->execute();
return $stmt->errorInfo();
}