1 2 3 4 5 6 7 8 9
| $req=$bdd->prepare('INSERT INTO liste_patients(rfid,nom,prenom,sexe,age,date_hospitalisation,date_sortie)VALUES
(:rfid_,:nom_,:prenom_,:sexe_,:age_,:dateh_,:dates_)');
if (!empty($_POST['dates_p'])){
$req->bindParam(':dates_',$_POST['dates_p']);}
else{
$req->bindParam(':dates_',NULL,PDO::PARAM_NULL);}
$req->execute( array('rfid_'=>$_POST['rfid_p'],'nom_'=>$_POST['nom_p'],'prenom_'=>$_POST['prenom_p'],'sexe_'=>$_POST['sexe_p'],
'age_'=>$_POST['age_p'],'dateh_'=>$_POST['dateh_p'],'dates_'=>$_POST['dates_p']));
$req->closeCursor(); |
Partager