-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbdd.php
27 lines (23 loc) · 1.25 KB
/
bdd.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
// Création de la connexion
$server = "localhost";
$database = "marieteam";
$user = "root"; // ! USER PHPmyAdmin
$password = ""; // ! MOT DE PASSE PHPmyAdmin
$cnt = mysqli_connect($server, $user, $password); // Connexion Serveur BDD (serveur,user,mdp)
$mabase = mysqli_select_db($cnt, $database); // Choix de la BDD : marieteam (defaut)
// REQUETES SQL :
if ($cnt) {
$res1 = mysqli_query($cnt, "SELECT * FROM port"); // Requête pour afficher tout les ports
$res2 = mysqli_query($cnt, "SELECT * FROM port"); // Requête pour afficher tout les ports
$res3 = mysqli_query($cnt, "SELECT * FROM port"); // Requête pour afficher tout les ports
$res4 = mysqli_query($cnt, "SELECT COUNT(port.ville) FROM port;"); // Requête pour compter le nombre de ports
}
// TEST FUNCTION
/*function rechercheH($villed,$villea,$dated){
$cnt = mysqli_connect('localhost', 'root', '');
$mabase = mysqli_select_db($cnt, "marieteam");
$res_horaire = mysqli_query($cnt, "SELECT * FROM liaison,trajet WHERE liaison.idvilleDepart='$villed' AND liaison.idvilleArrivee='$villea' AND liaison.idLiai=trajet.idLiai AND trajet.dateDepart='$dated';");
return $res_horaire;
}*/
?>