This error continue to pop up and i can't find any solution this is the code:
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
if ($_POST['function']=='insert'){
if ($_POST['Titolo'] == '' || $_POST['Eta'] == ''|| $_POST['Piattaforma'] == ''|| $_POST['NGioc'] == ''){
echo'<p>Attenzione riempire i campi obbligatori';
}
}
else{
$conn = new PDO('mysql:host=localhost;dbname=videogamelist', 'root', 'root',array(PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION));
$sql = "insert into games (Copertina,Titolo,Descrizione,Eta,Piattaforma,NGioc,Genere,DUscita,Sviluppatore)
values (:Copertina,:Titolo,:Descrizione,:Eta,:Piattaforma,:NGioc,:Genere,:DUscita,:Sviluppatore)";
$res_prepare = $conn->prepare($sql);
$res_prepare->bindParam(':Copertina',$_POST['Copertina']);
$res_prepare->bindParam(':Titolo',$_POST['Titolo']);
$res_prepare->bindParam(':Descrizione',$_POST['Descrizione']);
$res_prepare->bindParam(':Eta',$_POST['Eta']);
$res_prepare->bindParam(':Piattaforma',$_POST['Piattaforma']);
$res_prepare->bindParam(':NGioc',$_POST['NGioc']);
$res_prepare->bindParam(':Genere',$_POST['Genere']);
$res_prepare->bindParam(':DUscita',$_POST['DUscita']);
$res_prepare->bindParam(':Sviluppatore',$_POST['Sviluppatore']);
$res_prepare->execute();
echo'Gioco inserito';
}
?>
Almost all the record give this error and if i allow null value it will input only null value