bjr chers Tous,
je viens vous exposer un problème toujours dans la finalisation de mon application!! toute aide urgente me sera utile,

Au fait je voudrais pouvoir modifier et supprimer un enregistrement! ce qui est particulier dans ce cas est que l'affichage d'un enregistrement est fonction du type de sélection de la table, voici mon code php de formulation de la requête:
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
 
if (isset($_POST['envoyer']))
 {
   $designation = stripslashes($_REQUEST['designation']);
   $type = stripslashes($_REQUEST['type']);
 
     if($type==='consommable')
      {
        $sql = "SELECT * FROM consommable where designation = '$designation' ";
        //$nombreResultatRequete = count($sql);
        }
 
        if($type==='materiels')
      {
        $sql = "SELECT * FROM materiels where designation = '$designation' ";
        //$nombreResultatRequete = count($sql);
        }
 
        if($type==='equipement')
      {
        $sql = "SELECT * FROM equipement where designation = '$designation' ";
        //$nombreResultatRequete = count($sql);
        }
ce qui signifie que le resultat de la requête intervient en fonction du type d'où la fixation sur la table en question(consommable, matériels, équipement)... J'aimerais pouvoir modifier et supprimer un enregistrement quelque soit le résultat affiché! mon problème est puisque je ne connais pas la table ou faire le update d'avance, et que la modification dependra de la selection de l'utilisateur.

Voici l'affichage des resultats:
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
 
try{
   $pdo = new PDO($dsn, $username, $password);
   $stmt = $pdo->query($sql);
 
   if($stmt === False)
   {
    die("Erreur ");
   }
 
     }catch (PDOException $e){
    echo $e->getMessage();
 
  }
 
  }
?>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
 
 <h1><center><font color="red"></font> <u> Resultat(s) correspondant a votre recherche</u></center></h1>
 <table align="center" border="1">
   <thead>
     <tr>
       <th><font size="+2">Identifiant</font></th>
       <th><font size="+2">Reference</font></th>
       <th><font size="+2">Type</font></th>
       <th><font size="+2">Designation</font></th>
       <th><font size="+2">Numero de serie</font></th>
       <th><font size="+2">Etat</font></th>
       <th><font size="+2">Quantite</font></th>
       <th><font size="+2">Date</font></th>
       <th></th>
 
     </tr>
   </thead>
   <tbody>
     <?php while($row = $stmt->fetch(PDO::FETCH_ASSOC)) : ?>
     <tr>
       <td align="center"><?php echo htmlspecialchars($row['identifiant']); ?></td>
       <td align="center"><?php echo htmlspecialchars($row['reference']); ?></td>
       <td align="center"><?php echo htmlspecialchars($row['type']); ?></td>
       <td align="center"><?php echo htmlspecialchars($row['designation']); ?></td>
       <td align="center"><?php echo htmlspecialchars($row['numero_serie']); ?></td>
       <td align="center"><?php echo htmlspecialchars($row['etat']); ?></td>
       <td align="center"><?php echo htmlspecialchars($row['quantite']); ?></td>
       <td align="center"><?php echo htmlspecialchars($row['date']); ?></td>
       <td align="center"><a href="modifier1.php"> modifier </a> </td>
       <td align="center"><a href="supprimer.php"> supprimer </a> </td>
     </tr>
     <?php endwhile; ?>
   </tbody>
alors j'aimerais savoir comment se fera la modification et la suppression de l'enregistrement en question?

si l'enregistrement s'affiche il faut un lien modifier et supprimer qui va récupérer les infos en question et permettre à l'utilisateur d'exécuter ces actions.