Bonjour.
Pouvez vous me dire pourquoi ces requêtes ne fonctionnent pas ? Aucune erreur ne m'est renvoyée et rien ne se fait au niveau de la modification.
Voici les codes tout simples pour faciliter la lecture.
Dans ma table j'ai bien id_location et designation

Le formulaire

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
<?php include("../header.php"); ?>
<h2>Modification désignation</h2>
     <form action="modif_designation.php" method="POST">
     <label for="id_location">Numéro de la location</label> : <input type="text" name="id_location" id="id_location" /><br />
                <input type="submit" value="Envoyer" />
    </body>
</html>
________________

modif_designation.php

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
<?php include("../header.php"); ?>
<?php include("../connect_ovh.php"); ?>
<h3>Modifier désignation </h3>  
 
    <form method="POST" action="designation.php"> 
         <?php if (isset($_POST['id_location'])) { echo $_POST['id_location']; } ?>
        <textarea name="designation" rows="10" cols="80"><?= $designation; ?></textarea> <br />
    <input type="submit" value="Envoyer" />  
    </form>  
 </body>
</html>
Là je fais mes modifications
_____________________

le update designation.php qui ne fonctionne pas : erreur serveur

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
<?php include("../header.php"); ?>
<?php include("../connect_ovh.php"); ?>
<?php
$req = $bdd->prepare('UPDATE infos_contrat SET designation = :nvdesignation   WHERE id_location = :id_location');
$req->execute(array(
  ':nvdesignation' => $nvdesignation,
  ':id_location' => $id_location
 
  ));
echo 'La modification a été faite !';
?>
    </body>
</html>