1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
$ID_Interne=$_POST['ID_Interne'];
$CNAP=$_POST['CNAP'];
$Nom=$_POST['Nom'];
$Prenom=$_POST['Prenom'];
$Sexe=$_POST['Sexe'];
$Date_de_Naissance=$_POST['Date_de_Naissance'];
$Date_de_Creation=$_POST['Date_de_Creation'];
$insertSQL="INSERT INTO `Test.registre_personnes`
(ID_Interne,
CNAP,
Nom,
Prenom,
Sexe,
Date_de_Naissance,
Date_de_Creation
)
VALUES (
'".$ID_Interne."',
'".$CNAP."',
'".$Nom."',
'".$Prenom."',
'".$Sexe."',
'".$Date_de_Naissance."',
'".$Date_de_Creation."'
)";
/*si ID_Interne est auto increment primary*/
$params=array($ID_Interne,
$CNAP,
$Nom,
$Prenom,
$Sexe,
$Date_de_Naissance,
$Date_de_Creation);
if($query = sqlsrv_query($conn,$insertSQL,$params)){
//bon
}
else{
echo $insertSQL.' pas bon';
}
/* Close the connection. */
sqlsrv_close( $conn);
?> |
Partager