So, I created an HTML form to retrieve the data with PDO, the problem is here, every time I run my code, a blank page appears without any error and I don’t understand why. This happens to me a lot, that’s why I’m asking for your help, thank you very much
this is my Php code
<?php
include "connectBdd.php";
try {
$sql="INSERT into journaliste(noemile, nomjourna,prenomjourna,villejourna,adressmailjourna,adressjourna,journaltel, codepostaljourna) values(:prenom,:ville,:mail,:perso,:tel,:code,:nom,:emile)";
if($_POST["listem"]=="-1"){
$em=null;
}
else
{
$em=$_POST["listem"];
}
$resultat = $cnx->prepare($sql);
$nbLignes= $resultat->execute(array(":nom"=> $_POST["nom"],
":emile"=> $em,
":ville"=> $_POST["ville"],
":mail"=> $_POST["mail"],
":perso"=> $_POST["perso"],
":tel"=> $_POST["numero"],
":code"=> $_POST["code"],
":prenom"=> $_POST["prenom"]));
echo $nbLignes." ligne ajoutée";
}
Thank you