Probleme de recuperation de l'ID

IGOR - Modifié le 21 mai 2023 à 11:33

Bonjour,

svp j'aimerais que vous m'aidiez sur un problème.

J'ai un projet ou je but depuis un moment déjà. C'est une page ou je récupère les information entre dans la bd et je les affiche dans un tableau sur une page ou sur chaque ligne du tableau il y'a l'option supprimer. j'aimerais donc savoir quel code mettre pour que lorsque on clique sur le supprimer d'une ligne cette ligne ce supprimer dans ma bd et sur le tableau.

Voici le code de récupération et d'affichage.

<table>
                        <tr>
                            <th>N°</th>
                            <th>NOM DU LIVRE</th>
                            <th>NOM DE L'EDITEUR</th>
                            <th>CATEGORIE</th>
                            <th>ANNEE D'EDITION</th>
                            <th>NOM DU CLIENT</th>
                            <th>PRENOM DU CLIENT</th>
                            <th>NUMERO CNI</th>
                            <th>DATE DE NAISSANCE</th>
                            <th>DATE DE RESERVATION</th>
                            <th>ACTION1</th>
                            <th>ACTION2</th>
                            <th>POSITION</th>
                        </tr>
                    

                    <?php
            $Query="SELECT * FROM client";
            $Execute=mysqli_query($connection,$Query);
            $numero=0;
            while ($ligne=mysqli_fetch_array($Execute)) {
                $numero++;
                $id=$ligne['id'];
                $nomlivre=$ligne['nomlivre'];
                $nomedit=$ligne['nomedit'] ;
                $category=$ligne['category'];
                $anneeedit=$ligne['anneeedit'];
                $nom=$ligne['nom'];
                $prenom=$ligne['prenom'] ;
                $numcni=$ligne['numcni'];
                $datenaissance=$ligne['datenaissance'];
                $datereservation=$ligne['datereservation'];
        ?>
                    <tr>
                        <td><?php echo $numero; ?></td>
                        <td><?php echo $nomlivre; ?></td>
                        <td><?php echo $nomedit; ?></td>
                        <td><?php echo $category; ?></td>
                        <td><?php echo $anneeedit; ?></td>
                        <td><?php echo $nom; ?></td>
                        <td><?php echo $prenom; ?></td>
                        <td><?php echo $numcni; ?></td>
                        <td><?php echo $datenaissance; ?></td>
                        <td><?php echo $datereservation; ?></td>
                        <td><input type="Submit" name="accepter"  class="btn btn-success " value="ACCEPTER"></td>
                        <td><input name="refuser" type="submit" class="btn btn-danger" value="REFUSER"></td>
                    </tr>
        <?php
            }
        ?>
    </table>
Rejoignez-nous