-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeletEvent.php
More file actions
48 lines (30 loc) · 1.07 KB
/
deletEvent.php
File metadata and controls
48 lines (30 loc) · 1.07 KB
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
48
<?php
$nom=$_GET['nomEvent'];
$server='localhost';
$db='trello';
$login='root';
$mdp='';
// connection alabdd
try {
$linkpdo = new PDO("mysql:host=$server;dbname=$db", $login, $mdp); //chemin de la base de données a ajouter avec login et mdp
}catch (Exception $e) {
die('Erreur : '.$e->getMessage());
}
?>
<script type="text/javascript">
if (confirm("Etes vous sur de vouloir surpimer cette evenement ? ")) {
<?php
$req= $linkpdo -> prepare('select id from evenement where nom like :nom');
$req -> execute(array('nom'=> $nom ));
$id = $req-> fetch();
$id = $id[0];
$req = $linkpdo -> prepare('delete from evenement where nom like :nom');
$req-> execute(array('nom' => $nom));
$req = $linkpdo -> prepare('delete from participe where idEvent like :idEvent');
$req-> execute(array('idEvent' => $id));
?>
document.location.href="http://localhost/scan/compteAdmin.php";
} else {
document.location.href="http://localhost/scan/compteAdmin.php";
}
</script>