Bonjour,
Désolé d'avoir été grossier avec toi.
Pratique comme réponse pour trouver l'erreur...
Mais tu m'a pris de court et je n'ai pas voulu partir sans essayer ta derniére solution.
En ce qui concerne le problème en question dans PostgreSql, si je tiens compte de ta remarque suivante:
Tu mélanges tout: on est pas encore arrivé au SGBD, on est en PHP et on construit une requête:
,il m'est alors impossible de mettre une variable sans les apostrophes
'".$sortie."'
du coup impossible de mettre NULL sans qu'il soit considéré comme une chaine de caratére.
J'ai fais ceci mais c'est long et fastidieux mais cela fonctionne
if ($_SESSION[DateEntree] && $_SESSION[DateSortie] && $_SESSION[DateF70bis])
{
$sql3 = "INSERT INTO dossier (idparticipant, dosentree, dossortie, dosdatef70bis) VALUES ('$id[0]','$_SESSION[DateEntree]','$_SESSION[DateSortie]','$_SESSION[DateF70bis]' )";
}
elseif ($_SESSION[DateEntree] && $_SESSION[DateSortie] && $_SESSION[DateF70bis]=="")
{
$sql3 = "INSERT INTO dossier (idparticipant, dosentree, dossortie, dosdatef70bis) VALUES ('$id[0]','$_SESSION[DateEntree]','$_SESSION[DateSortie]',NULL )";
}
elseif ($_SESSION[DateEntree] && $_SESSION[DateSortie]=="" && $_SESSION[DateF70bis]=="")
{
$sql3 = "INSERT INTO dossier (idparticipant, dosentree, dossortie, dosdatef70bis) VALUES ('$id[0]','$_SESSION[DateEntree]',NULL,'NULL )";
}
elseif ($_SESSION[DateEntree]=="" && $_SESSION[DateSortie]=="" && $_SESSION[DateF70bis]=="")
{
$sql3 = "INSERT INTO dossier (idparticipant, dosentree, dossortie, dosdatef70bis) VALUES ('$id[0]',NULL,NULL,NULL )";
}
elseif ($_SESSION[DateEntree]=="" && $_SESSION[DateSortie] && $_SESSION[DateF70bis])
{
$sql3 = "INSERT INTO dossier (idparticipant, dosentree, dossortie, dosdatef70bis) VALUES ('$id[0]',NULL,'$_SESSION[DateSortie]','$_SESSION[DateF70bis]' )";
}
elseif ($_SESSION[DateEntree]=="" && $_SESSION[DateSortie]=="" && $_SESSION[DateF70bis])
{
$sql3 = "INSERT INTO dossier (idparticipant, dosentree, dossortie, dosdatef70bis) VALUES ('$id[0]',NULL,NULL,'$_SESSION[DateF70bis]' )";
}
elseif ($_SESSION[DateEntree]=="" && $_SESSION[DateSortie]=="" && $_SESSION[DateF70bis]=="")
{
$sql3 = "INSERT INTO dossier (idparticipant, dosentree, dossortie, dosdatef70bis) VALUES ('$id[0]',NULL,NULL,NULL )";
}
elseif ($_SESSION[DateEntree] && $_SESSION[DateSortie]=="" && $_SESSION[DateF70bis])
{
$sql3 = "INSERT INTO dossier (idparticipant, dosentree, dossortie, dosdatef70bis) VALUES ('$id[0]','$_SESSION[DateEntree]',NULL,'$_SESSION[DateF70bis]' )";
}
elseif ($_SESSION[DateEntree]=="" && $_SESSION[DateSortie] && $_SESSION[DateF70bis]=="")
{
$sql3 = "INSERT INTO dossier (idparticipant, dosentree, dossortie, dosdatef70bis) VALUES ('$id[0]',NULL,'$_SESSION[DateSortie]',NULL )";
}
Voila ma solution.
Merci de ton aide et encore désolé de na pas t'avoir répondu correctement.
MaitrePylos