Bonjour à tous,
en fait je suis confronté à un problème que voici. En fait j'aimerai juste supprimer une entrée à partir de l'affichage des données dans un tableau grâce à un lien supprimer. Cependant ça ne marche pas.
Voici la page qui affiche la liste des entrées avec le lien supprimer.

liste_patient.php

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
 
<!doctype html>
<html class="no-js" lang="en">
 
<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>Sama - App - Manager - Tableau de bord Admin</title>
 
</head>
 
<body>
<div class="market-status-table mt-8">
                                   <div class="table-responsive">
                                        <table class="dbkit-table">
                                            <tr class="heading-td">
                                                <th class="">Modifier/Supprimer patient</th>
                                                <th class="">numéro patient</th>
                                                <th class="">Prénom</th>
                                                <th class="buy">Nom</th>
                                                <th class="">Adresse</th>
                                                <th class="">Date</th>
                                                <th class="">Nature opérations</th>
                                                <th class="">Prix Convenu</th>
                                                <th class="">Reçu</th>
                                                <th class="">A recevoir</th>
                                                <th class="">A reporter</th>
                                                <th class="">Observations</th>
                                            </tr>
                                             <?php
 
                                    $bdd = new PDO('mysql:host=localhost; dbname=espace_membres', 'root', '');
                                    $bdd = new PDO('mysql:host=localhost; dbname=espace_membres', 'root', '');
                                    $reponse = $bdd->query('SELECT * FROM inscription ORDER BY dateins DESC');
                                     // On affiche chaque entrée une à une
                                     while ($info_cl = $reponse->fetch())
                                    {
 
                                    ?>
 
 
                                            <tr align="center">
                                                <td><a href="supprimer_patient.php?id_e=<?php echo $info_cl['id_e'] ?>" onClick="confirm('Voulez-vous vraiment supprimer ?')" >supprimer</a><br>
                                                </td>
                                                <td><?php echo $info_cl['id_e']; ?></td>
                                                <td><?php echo $info_cl['prenom']; ?></td>
                                                <td><?php echo $info_cl['nom']; ?></td>
                                                <td><?php echo $info_cl['adresse']; ?></td>
                                                <td><?php echo $info_cl['dateins']; ?></td>
                                                <td><?php echo $info_cl['operations']; ?></td>
                                                <td><?php echo $info_cl['prix']; ?></td>
                                                <td><?php echo $info_cl['recu']; ?></td>
                                                <td><?php echo $info_cl['arecevoir']; ?></td>
                                                <td><?php echo $info_cl['areporter']; ?></td>
                                                <td><?php echo $info_cl['observations']; ?></td>
                                            </tr>
 
                                    <?php
                                        }
                                            $reponse->closeCursor(); 
                                    ?>
                                        </table>
                                    </div>
 
                                </div>

et voici la page supprimer_patient.php

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
 
<php
 
      $bdd = new PDO('mysql:host=localhost;dbname=espace_membres', 'root', '');
 
                        if(isset($_GET['id_e'])){
                        $supatient = $bdd->prepare("DELETE FROM inscription WHERE id_e = ?");
                        $query = $bdd->prepare($supatient);
 
                        $res = $query->execute(array($_GET['id_e']));
                        if ($res == false) {
                        print_r($query->errorInfo());
                         die ('Erreur execute');
                                            } 
}
 
        echo '<p>Patient supprim&eacute; avec succès ! <br />
        Cliquez <a href="liste_patient.php">ici</a> pour retourner &agrave; la liste des patients</p>';
 
 
?>
merci pour votre précieuse aide SVP !