Bonjour,
voici mon code merci a ceux qui auront le courage de le lire j'ai l'impression que c'est mon cas type="hidden" qui n'est pas reconnu
<form method="post" action="ajouthoraire.php" enctype="multipart/form-data">
<input type="hidden" value="<?php $idhoraire ;?>" name="idhoraire"/>
<center><h4>Horaire Magasin :</h4></center>
<?php
include('connect.php');
try{
$cnx = new PDO(DSN, LOGIN, PASSWORD, $options);
$sql = "SELECT * FROM horaire";
$res = $cnx->query($sql);
echo "<table><tr>\n<th><center>Jour</center></th>\n<th><center>Matin</center></th>\n<th><center>Aprem-midi</center></th></tr>";
while ($ligne = $res->fetch()){
echo "<tr>\n<td><center>".$ligne['jour']."</center></td>\n<td><center>
<input type='text' value='".$ligne['heuredebutmat']."' name='heuredebutmat'/>
<input type='text' value='".$ligne['heurefinmat']."' name='heurefinmat'/></center>\n</td>\n<td><center>
<input type='text' value='".$ligne['heuredebutap']."' name='heuredebutap'/>
<input type='text' value='".$ligne['heurefinap']."' name='heurefinap'/></center></td></tr>";}
echo "</table>";}
catch(PDOException $e){
die("Echec : ".$e->getMessage());
}
?><br /><br />
<input type="submit" value="Enregistrer" /> <input type="reset" value="Effacer" /></p><br /><br /></form>
<?php
include('connect.php');
$heuredebutmat=$_POST['heuredebutmat'];
$heurefinmat=$_POST['heurefinmat'];
$heuredebutap=$_POST['heuredebutap'];
$heurefinap=$_POST['heurefinap'];
$idhoraire=$_POST['idhoraire'];
if(($heuredebutmat != "" && $heurefinmat != "" && $heuredebutap != "" && $heurefinap != "")){
try{
$cnx = new PDO(DSN, LOGIN, PASSWORD, $options);
$sql = "UPDATE horaire SET heuredebutmat='$heuredebutmat', heurefinmat='$heurefinmat',
heuredebutap='$heuredebutap', heurefinap='$heurefinap' WHERE idhoraire='$idhoraire'";
$cnx->exec($sql);
$cnx=null;
echo 'Enregistrement du(des) nouvel(aux) horaire(s) effectués !<br />';}
catch(PDOException $e){
die("Echec : ".$e->getMessage()); }}
else{
echo 'Erreur : Vous devez remplir tout les champs.';}
?>
Notice: Undefined variable: idhoraire in C:\Program Files (x86)\EasyPHP-DevServer-13.1VC9\data\localweb\xxxxxx\modifierhoraire.php on line 42
[heuredebutmat] => 10:00:00 [heurefinmat] => 12:00:00 [heuredebutap] => 14:00:00 [heurefinap] => 19:00:00 ) Enregistrement du(des) nouvel(aux) horaire(s) effectués !
j'ai cru que tu voulais que le début ^^