voilà je n'arrive pas à afficher la valeur A ou P sur ma table mysqlet quand je clique sur absent ou present voilà ce que j'ai :
voici le code de ma page :
<?php include "conn.inc.php";?>
<html>
<head>
<title> EMAK-LISTE DES ELEVES</title>
<style type="text/css">
TD{color :#353535;font-family:verdana }
TH{color :#FFFFFF;font-family:verdana;background-color:#336699 }
</style>
</head>
<style type="text/css"></style>
<LINK href="/emak/app/stili/st.css" type=text/css rel=stylesheet>
<body bgcolor="#AEC7DF" LEFTMARGIN="0" TOPMARGIN="0" marginwidth="0" marginheight="0">
<table border="0" height="99.5" width="93.5%">
<CAPTION>
<tr>
<td bgcolor ="#004080" colspan ="2" align="center" CLASS="title2">
L'APPEL DE PRESENCE
<a HREF="">
<input name="button" type="image" class="NavButton" id="button1" onClick="window.print();" value="Imprimer" src="/emak/app/images/print.png">
</a>
</td>
</tr>
</CAPTION>
<tr>
<!--titres des colonnes!-->
<tr>
<td bgcolor ="gray" align="center" colspan ="1" width ="20%" class ="tx4" > Nom </td>
<td bgcolor ="gray" align="center" colspan ="1" width ="20%" class ="tx4" > Prenom </td>
<td bgcolor ="gray" align="center" colspan ="1" width ="20%" class ="tx4" > Present/Absent </td>
<td bgcolor ="gray" align="center" colspan ="1" width ="20%" class ="tx4" > Heure de cours </td>
<td bgcolor ="gray" align="center" colspan ="1" width ="20%" class ="tx4" > Classe </td>
<td bgcolor ="#AEC7DF" align="center" colspan ="1" width ="13%" class ="tx4" > </td>
</tr>
<?php
try
{
$bdd = new PDO('mysql:host=localhost;dbname=emak;charset=utf8', 'root', '');
}
catch(Exception $e)
{
die('Erreur : '.$e->getMessage());
}
$reponse = $bdd->query('SELECT * FROM tableau_journalier order by id ');
while ($donnees = $reponse->fetch())
{
?>
<!--détail des lignes!-->
<tr>
<td bgcolor ="white" align="center" width ="20%" class ="tx4" > <?php echo $donnees ['CD_NOM' ] ; ?> </td>
<td bgcolor ="white" align="center" width ="20%" class ="tx4" > <?php echo $donnees ['CD_PRENOM' ] ; ?> </td>
<?php
try
{
$bdd = new PDO('mysql:host=localhost;dbname=emak;charset=utf8', 'root', '');
}
catch(Exception $e)
{
die('Erreur : '.$e->getMessage());
}
$appel = $_POST['appel'];
if(isset($_POST['appel'])){
$req = $bdd->prepare('INSERT INTO tableau_journalier(CD_PRESENT) VALUES(:appel)');
$req->execute(array(
'appel' => $appel
));
if($req->execute()) { // execute() répond true/false
echo " La requête fonctionne ! ";
} else {
echo "Echec lors de l'exécution de la multi-requête : (" . $req->errno . ") " . $req->error;
}
}
elseif(!isset($_POST['appel'])){
echo 'Vous n\'avez rien selectionné ';
}
?>
<td bgcolor ="white" align="center" width ="20%" class ="tx4" >
<form method="post" action="rolecontents.php">
<p>
<input type="radio" name="appel" value='P' id="P" /> <label for="P">Présent</label><br />
<input type="radio" name="appel" value='A' id="A" /> <label for="A">Absent</label><br />
</p>
<input type="submit" name="submit" value="Envoyer" />
</form>
</td>
<td bgcolor ="white" align="center" width ="20%" class ="tx4" > <?php echo $donnees ['HEURE_COURS' ] ; ?> </td>
<td bgcolor ="white" align="center" width ="20%" class ="tx4" > <?php echo $donnees ['DF_CLASSE' ] ; ?> </td>
<td bgcolor ="#AEC7DF" align="center" width ="13%" align ="right">
<a href ="editliste.php?action=edit&id=<?php echo $row['ID'] ; ?>">
<img src="/emak/app/images/edit.png" alt="Modifier" LEFTMARGIN="0" ALIGN=left>
</a>
<!--a HREF="">
<input name="button" type="image" class="NavButton" id="button1" onClick="myFunction();"
value="Imprimer" src="/emak/app/images/delete.png">
</a!-->
<a href ="delliste.php?type=liste_eleve&id=<?php echo $row['ID'] ; ?>">
<img src="/emak/app/images/delete.png" alt="Eliminer" LEFTMARGIN="0" ALIGN=left>
</a>
</td>
</tr>
</tr>
<?php
}
?>
</table>
</body>
Merci d'avance