"; 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 ""; echo ""; if (isset($c['SexeEleve'])){ echo ""; }else{ echo ""; } echo ""; echo "
Nom:".$c['NomEleve']."
Prénom:".$c['PrenomEleve']."
Sexe:".$c['SexeEleve']."
Sexe:Aucun
Classe:".$c['ClasseEleve']."
"; }else{ echo "Une des valeurs n'a pas été remplie!"; } } echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
Prénom:
Nom:
Sexe:"; echo "F  "; echo "M  "; echo "A"; echo "
Classe:
"; echo "
"; echo "
"; echo ""; ?>