I have tried to build an insert statement. The code is run without any mistake but the data will not store into the database. But I can't see what the problem is. Here my code...
if (isset($_POST["submit_eingabemaskeR"]))
{
$tore = $_POST['tore'];
$note = $_POST['note'];
$spielPlan = $_POST['SpielerNummer'];
$spielerID = "123";
$pdoInsert = new PDO('mysql:host=localhost;dbname=tmp_bundesliga;charset=utf8mb4', 'root');
$sqlInsert = "INSERT into `SpielerStats` ('Player_ID', 'Note', 'Tore', 'Spielplan_ID') VALUES (:tore, :note, :spielPlanID, :spielerID)";
$pdoResult = $pdoInsert->prepare($sqlInsert);
$pdoExec = $pdoResult->execute(array(":tore"=>$tore, ":note"=>$note, ":spielPlanID"=>$spielPlan, ":spielerID"=>$spielerID));
if($pdoExec){
echo 'Data insert';
}else{
echo 'Data not insert';
}
}
Thank you for helping me!