本文整理汇总了PHP中DataBase::connect方法的典型用法代码示例。如果您正苦于以下问题:PHP DataBase::connect方法的具体用法?PHP DataBase::connect怎么用?PHP DataBase::connect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataBase
的用法示例。
在下文中一共展示了DataBase::connect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: modifier_reclamation
public function modifier_reclamation($id, $rep, $etat)
{
$select = DataBase::connect()->query("update reclamation set repense='{$rep}',etat='{$etat}' where id_rec='{$id}' ");
if ($select) {
return true;
}
}
示例2: supprimer_reclamtion
public function supprimer_reclamtion($id)
{
$delete = DataBase::connect()->query("delete from reclamation where id_reclamation = '{$id}'");
if ($delete) {
return true;
}
}
示例3: supprimer_support
public function supprimer_support($id)
{
$delete = DataBase::connect()->query("delete from support where id_support = '{$id}'");
if ($delete) {
return true;
}
}
示例4: supprimer_demande
public function supprimer_demande()
{
$delete = DataBase::connect()->query("delete from demande where id_demande = '{$this->id}'");
if ($delete) {
return true;
}
}
示例5: supprimer_certificat
public function supprimer_certificat($id)
{
$delete = DataBase::connect()->query("delete from certificat where id_certificat = '{$id}'");
if ($delete) {
return true;
}
}
示例6: changer_pass
public function changer_pass($npass, $type)
{
$MODIFIER = DataBase::connect()->prepare('UPDATE responsable SET
pass=:pass where type=:type');
try {
$success = $MODIFIER->execute(array('pass' => $npass, 'type' => $type));
} catch (Exception $e) {
echo 'Erreur de requète : ', $e->getMessage();
}
return true;
}
示例7: modifier_panne
public function modifier_panne($id, $date, $etat)
{
$up = DataBase::connect()->prepare('update panne SET
(date_p=:date,etat=:etat where id_panne=:id_panne)');
try {
$update = $up->execute(array('id_panne' => $id, 'date' => $date, 'etat' => $etat));
} catch (Exception $e) {
echo 'Erreur de requète : ', $e->getMessage();
}
return true;
}
示例8: liste_chaufeur_date
public function liste_chaufeur_date($date)
{
$select = DataBase::connect()->query("select * from chaufeur where chaufeur.id_ch not in (select id_ch from sortie where date={$date})");
$row = array();
while ($donnees = $select->fetch(PDO::FETCH_OBJ)) {
echo "<option value='{$donnees->id_ch}'>";
echo $donnees->nom . " " . $donnees->prenom;
echo "</option>";
}
return true;
}
示例9: contact
public function contact($email, $sujet, $texte)
{
$insert = DataBase::connect()->prepare('insert into contact
VALUES (NULL,:email,:sujet,:texte)');
try {
$success = $insert->execute(array('email' => $email, 'sujet' => $sujet, 'texte' => $texte));
} catch (Exception $e) {
echo 'Erreur de requète : ', $e->getMessage();
}
return true;
}
示例10: ajouter
public function ajouter()
{
$insert = DataBase::connect()->prepare('insert into historique VALUES
(NULL,:date,:solde,:id_client)');
try {
$ins = $insert->execute(array('date' => $this->date, 'solde' => $this->solde, 'id_client' => $this->id_client));
} catch (Exception $e) {
echo 'Erreur de requète : ', $e->getMessage();
}
return true;
}
示例11: traiter_demande
public function traiter_demande($id, $rep)
{
$up = DataBase::connect()->prepare('update demande SET
etat=:rep where id_demande=:id');
try {
$update = $up->execute(array('rep' => $rep, 'id' => $id));
} catch (Exception $e) {
echo 'Erreur de requète : ', $e->getMessage();
}
return true;
}
示例12: modifier_journaliste
public function modifier_journaliste($nom, $prenom, $type, $login, $id)
{
$up = DataBase::connect()->prepare('update journaliste SET
nom=:nom,prenom=:prenom,type=:type,login=:login where id_jour=:id');
try {
$update = $up->execute(array('nom' => $nom, 'prenom' => $prenom, 'type' => $type, 'login' => $login, 'id' => $id));
} catch (Exception $e) {
echo 'Erreur de requète : ', $e->getMessage();
}
return true;
}
示例13: delete
public function delete($noticia)
{
try {
$database = new DataBase();
$mdb = $database->connect();
$query = $mdb->prepare('DELETE FROM noticias WHERE idnoticia = ?');
$query->bindParam(1, $noticia->idNoticia);
return $query->execute();
} catch (PDOException $e) {
$e->getMessage();
}
}
示例14: delete
public function delete($profesional)
{
try {
$database = new DataBase();
$mdb = $database->connect();
$query = $mdb->prepare('DELETE FROM profesionales WHERE matricula = ?');
$query->bindParam(1, $profesional->matricula);
return $query->execute();
} catch (PDOException $e) {
$e->getMessage();
}
}
示例15: total_heur
public function total_heur($id_user)
{
$nbr_h = 0;
$select = DataBase::connect()->query("select *,sum(heur_s-heur_e) as nbr from pointage as p inner join personnel as pl on p.id_personnel=pl.id_personnel ORDER BY id_pointage DESC");
while ($donnees = $select->fetch(PDO::FETCH_OBJ)) {
$id_pointage = $donnees->id_pointage;
$date_t = $donnees->date_t;
$heur_e = $donnees->heur_e;
$heur_s = $donnees->heur_s;
$nbr = $donnees->nbr;
$mois = $donnees->mois;
}
}