本文整理汇总了PHP中DatabaseManager::getDb方法的典型用法代码示例。如果您正苦于以下问题:PHP DatabaseManager::getDb方法的具体用法?PHP DatabaseManager::getDb怎么用?PHP DatabaseManager::getDb使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DatabaseManager
的用法示例。
在下文中一共展示了DatabaseManager::getDb方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: LastNews
public static function LastNews()
{
$db = DatabaseManager::getDb();
$requete = "SELECT * FROM news order by date_news DESC";
$tableau = array();
foreach ($db->query($requete) as $row) {
$tableau[] = new News($row['ID_NEWS'], $row['DATE_NEWS'], $row['TITRE'], $row['TEXTE']);
}
return $tableau;
}
示例2: ListerPourPaladin
public static function ListerPourPaladin()
{
$db = DatabaseManager::getDb();
$requete = "SELECT * FROM " . PREFIX_DB . "dieu where DIEU_PALADIN = 1";
$tableau = array();
$stmt = $db->prepare($requete);
$stmt->execute();
while ($rs = $stmt->fetch(PDO::FETCH_ASSOC)) {
$tableau[] = new dieu($rs);
}
return $tableau;
}
示例3: Arme
<?php
include __DIR__ . "/config/config.php";
include __DIR__ . "/model/autoloader.class.php";
$db = DatabaseManager::getDb();
$requete = "select * \n from " . PREFIX_DB . "lien_aventurier_arme\n join " . PREFIX_DB . "arme on " . PREFIX_DB . "arme.ARME_ID = " . PREFIX_DB . "lien_aventurier_arme.ID_ARME LIMIT 10, 9999";
$stmt = $db->prepare($requete);
$stmt->execute();
while ($rs = $stmt->fetch(PDO::FETCH_ASSOC)) {
$arme = new Arme($rs);
$arme->ARME_AVENTURIER_ID = $rs["ID_AVENTURIER"];
$arme->ajouter();
}
示例4: determineCompetences
public function determineCompetences()
{
if ($this->METIER != "" && $this->ORIGINE != "") {
if ($this->METIER->ID == 99) {
$this->COMPETENCESLIEES = $this->METIER->COMPETENCESLIEES;
} else {
$this->COMPETENCESLIEES = fusionneCompetencesSansDoublons($this->METIER->COMPETENCESLIEES, $this->ORIGINE->COMPETENCESLIEES);
}
}
if (empty($this->ID)) {
return;
}
$db = DatabaseManager::getDb();
$requete = "SELECT * FROM lien_aventurier_competence WHERE ID_AVENTURIER = " . $this->ID;
$stmt = $db->prepare($requete);
$stmt->execute();
$this->COMPETENCESCHOISIES = array();
while ($ligne = $stmt->fetch(PDO::FETCH_ASSOC)) {
$comp = new Competence();
$this->COMPETENCESCHOISIES[] = $comp;
}
$this->competences = fusionneCompetencesSansDoublons($this->COMPETENCESCHOISIES, $this->COMPETENCESLIEES);
}
示例5: loadFromDB
public function loadFromDB($id)
{
$db = DatabaseManager::getDb();
$requete = "SELECT * FROM " . PREFIX_DB . "magie WHERE MAGIE_ID = " . $id;
$stmt = $db->prepare($requete);
$stmt->execute();
$ligne = $stmt->fetch(PDO::FETCH_ASSOC);
$this->LoadFromArray($ligne);
}
示例6: getConnexionDB
function getConnexionDB()
{
return DatabaseManager::getDb();
}
示例7: loadFromDB
public function loadFromDB($id)
{
$db = DatabaseManager::getDb();
$requete = "SELECT * FROM metier WHERE METIER_ID = " . $id;
$stmt = $db->prepare($requete);
$stmt->execute();
$ligne = $stmt->fetch(PDO::FETCH_ASSOC);
$this->METIER_ID = $ligne['METIER_ID'];
$this->METIER_NOM = $ligne['METIER_NOM'];
$this->METIER_EV = $ligne['METIER_EV'];
$this->METIER_EA = $ligne['METIER_EA'];
$this->METIER_AT = $ligne['METIER_AT'];
$this->METIER_PRD = $ligne['METIER_PRD'];
$this->METIER_FOMIN = $ligne['METIER_FOMIN'];
$this->METIER_FOMAX = $ligne['METIER_FOMAX'];
$this->METIER_ADMIN = $ligne['METIER_ADMIN'];
$this->METIER_ADMAX = $ligne['METIER_ADMAX'];
$this->METIER_INTMIN = $ligne['METIER_INTMIN'];
$this->METIER_INTMAX = $ligne['METIER_INTMAX'];
$this->METIER_CHAMIN = $ligne['METIER_CHAMIN'];
$this->METIER_CHAMAX = $ligne['METIER_CHAMAX'];
$this->METIER_COUMIN = $ligne['METIER_COUMIN'];
$this->METIER_COUMAX = $ligne['METIER_COUMAX'];
$this->METIER_RESTRICTION = $ligne['METIER_RESTRICTION'];
$this->METIER_BONUS = $ligne['METIER_BONUS'];
$this->METIER_PRMAX = $ligne['METIER_PRMAX'];
$db = DatabaseManager::getDb();
$requete = "SELECT ID_COMPETENCE FROM lien_metier_competence_native WHERE ID_METIER = " . $id;
$stmt = $db->prepare($requete);
$stmt->execute();
while ($ligne = $stmt->fetch(PDO::FETCH_ASSOC)) {
$competence = new Competence($ligne["ID_COMPETENCE"]);
$this->METIER_COMPETENCESLIEES[] = $competence;
}
$requete = "SELECT ID_COMPETENCE FROM lien_metier_competence_choix WHERE ID_METIER = " . $id;
$stmt = $db->prepare($requete);
$stmt->execute();
while ($ligne = $stmt->fetch(PDO::FETCH_ASSOC)) {
$competence = new Competence($ligne["ID_COMPETENCE"]);
$this->METIER_COMPETENCESACHOISIR[] = $competence;
}
}
示例8: get_data_from_db
public function get_data_from_db($id)
{
$db = DatabaseManager::getDb();
$requete = "SELECT * FROM " . PREFIX_DB . "arme WHERE ARME_ID = " . $id;
$stmt = $db->prepare($requete);
$stmt->execute();
$ligne = $stmt->fetch(PDO::FETCH_ASSOC);
$this->loadFromArray($ligne);
}