Réponse acceptée !
Merci kohntark !
Grâce à toi ça fonctionne à présent, et visiblement la faille de sécurité qui était dans mon code est résolue par mysql_real_escape_string !
Par contre, j'ai essayé de compléter ma fonction en testant si l'id existe :
-> SI tel est le cas, un UPDATE doit se faire ;
-> SINON, c'est un INSERT qui doit prendre la relève !
Problème : lorsque ma fonction est lue, mysql_error() me dit : "Query was empty" !!!
Quoi que ça veut dire ???
Voici le code que j'ai mis en place :
$sqlSelWhatsUp="SELECT id FROM admin_whatsup WHERE id = '$id'";
$resSelWhatsUp=mysql_query($SelInsWhatsUp) or die (mysql_error());
$sqlInsWhatsUp="INSERT INTO admin_whatsup(heureWhatsUp,titreWhatsUp,textWhatsUp) VALUES('$dateJour','$newTitre',$newTexte)";
$resInsWhatsUp=mysql_query($sqlInsWhatsUp) or die (mysql_error());
$sqlUpdWhatsUp="UPDATE admin_whatsup SET heureWhatsUp = '$dateJour' , titreWhatsUp = '$newTitre' , textWhatsUp = '$newTexte' WHERE id = '$id'";
$resUpdWhatsUp=mysql_query($sqlUpdWhatsUp) or die (mysql_error());
if ($resSelWhatsUp) {
$resUpdWhatsUp;
}
else {
$resInsWhatsUp;
}
}