Skip to content

Commit

Permalink
modif bdd
Browse files Browse the repository at this point in the history
  • Loading branch information
henitsu committed Dec 15, 2023
1 parent 7130d51 commit dbab4ed
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
20 changes: 19 additions & 1 deletion Donnees/db_cabinet.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
create user 'etu1@localhost' identified by 'iutinfo';
CREATE OR REPLACE USER 'etu1'@'localhost' IDENTIFIED BY 'iutinfo';
DROP DATABASE IF EXISTS patientele;
create database patientele;
grant all privileges on patientele.* TO 'etu1'@'localhost' identified by 'iutinfo';
flush privileges;
USE patientele;

CREATE TABLE Medecin(
Id_Medecin INT AUTO_INCREMENT,
Expand All @@ -22,6 +27,14 @@ CREATE TABLE Usager(
FOREIGN KEY(Id_Medecin) REFERENCES Medecin(Id_Medecin)
);

CREATE TABLE Secretaire(
Id_Secretaire INT AUTO_INCREMENT,
Civilite VARCHAR(50),
Nom VARCHAR(50),
Prenom VARCHAR(50),
PRIMARY KEY(Id_Secretaire)
);

CREATE TABLE RDV(
idusager INT,
Id_Medecin INT,
Expand All @@ -32,6 +45,11 @@ CREATE TABLE RDV(
FOREIGN KEY(Id_Medecin) REFERENCES Medecin(Id_Medecin)
);

INSERT INTO `secretaire` (`Id_Secretaire`, `Civilite`, `Nom`, `Prenom`) VALUES ('1', 'Mlle', 'Jonquille', 'Tamara');
INSERT INTO `secretaire` (`Id_Secretaire`, `Civilite`, `Nom`, `Prenom`) VALUES ('2', 'Mme', 'Lapin', 'Marie');
INSERT INTO `secretaire` (`Id_Secretaire`, `Civilite`, `Nom`, `Prenom`) VALUES ('3', 'Mlle', 'Coquelicot', 'Annie');
INSERT INTO `secretaire` (`Id_Secretaire`, `Civilite`, `Nom`, `Prenom`) VALUES ('4', 'Mme', 'Tulipe', 'Suzanne');

INSERT INTO `medecin` (`Id_Medecin`, `Civilite`, `Nom`, `Prenom`) VALUES ('1', 'M', 'Dupont', 'Pierre');
INSERT INTO `medecin` (`Id_Medecin`, `Civilite`, `Nom`, `Prenom`) VALUES ('2', 'Mme', 'Dupuis', 'Jeanne');
INSERT INTO `medecin` (`Id_Medecin`, `Civilite`, `Nom`, `Prenom`) VALUES ('3', 'M', 'Dujardin', 'Jean');
Expand Down
9 changes: 8 additions & 1 deletion PHP/connexion.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
<?php

session_start();
$login = $_SESSION['identifiant'];
$password = $_SESSION['password'];

$pdo = new PDO("mysql:host=localhost;dbname=patientele", "etu1", "iutinfo");
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);


?>
4 changes: 2 additions & 2 deletions PHP/index.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<?php
/*

session_start();
$servname = "localhost";
$dbname = "patientele";
Expand All @@ -11,7 +11,7 @@
header('Location: /projetPHP2023/PHP/menu.php');
}else{
header('Location: /projetPHP2023/PHP/index.php');
}*/
}
?>

<!DOCTYPE html>
Expand Down

0 comments on commit dbab4ed

Please sign in to comment.