forked from space192/PiscineWeb22
-
Notifications
You must be signed in to change notification settings - Fork 0
/
queryLab.php
47 lines (47 loc) · 1.29 KB
/
queryLab.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
include_once 'const.php';
function getinfoLab($ID)
{
if(isset($ID))
{
global $mysqlConnection;
$memberStatement = $mysqlConnection->prepare("SELECT * FROM Labo WHERE ID_Labo='". $ID ."';");
$memberStatement->execute();
$result = $memberStatement->fetchAll();
return $result;
}
else
{
return null;
}
}
function getinfoLabG()
{
global $mysqlConnection;
$memberStatement = $mysqlConnection->prepare("SELECT * FROM Service;");
$memberStatement->execute();
$result = $memberStatement->fetchAll();
return $result;
}
function getEDTLab($ID)
{
if(isset($ID))
{
global $mysqlConnection;
$memberStatement = $mysqlConnection->prepare("SELECT * FROM EDT_Labo WHERE ID_Labo='". $ID ."';");
$memberStatement->execute();
$result = $memberStatement->fetchAll();
return $result;
}
else
{
return null;
}
}
if(isset($_POST["ID_Labo"]) && isset($_POST["ID_Client"]) && isset($_POST["ID_Service"]) && isset($_POST["Date"]))
{
$sql = "INSERT INTO utilisateur (ID_Labo,ID_Client,ID_Service,Date) VALUES (?,?,?,?)";
$stmt= $mysqlConnection->prepare($sql);
return $stmt->execute([$_POST["ID_Labo"], $_POST["ID_Client"], $_POST["ID_Service"],$_POST["Date"]]);
}
?>