"; echo "
Ajout d'un élève
"; if (isset($_POST['submit'])){ if (isset($_POST['nom']) && isset($_POST['prenom']) && isset($_POST['sexe']) && isset($_POST['classe'])){ $rqclients = "INSERT INTO bdsports.eleves (NomEleve, PrenomEleve, SexeEleve, ClasseEleve) VALUES ('".$_POST['nom']."', '".$_POST['prenom']."', '".$_POST['sexe']."', '".$_POST['classe']."')"; $repclients = $bdd->query($rqclients); $n = $bdd->lastInsertId(); $rqclients = "SELECT * FROM bdsports.eleves WHERE NoEleve='".$n."'"; $repclients = $bdd->query($rqclients); $c = $repclients->fetch(); if ($c['SexeEleve'] == "F"){ echo "Cette élève a été enregistrée"; }else{ echo "Cet élève a été enregistré"; } echo "
"; echo "
Nom:
".$c['NomEleve']."
"; echo "
Prénom:
".$c['PrenomEleve']."
"; if (isset($c['SexeEleve'])){ echo "
Sexe:
".$c['SexeEleve']."
"; }else{ echo "
Sexe:
Aucun
"; } echo "
Classe:
".$c['ClasseEleve']."
"; echo "
"; }else{ echo "Une des valeurs n'a pas été remplie!"; } } echo "
"; echo "
"; echo "
Prénom:
"; echo "
Nom:
"; echo "
Sexe:
"; echo "F
  "; echo "M
  "; echo "A
"; echo "
"; echo "
Classe:
"; echo "
"; echo "
"; echo "
"; echo ""; ?>