I have created a form for users to submit information which gets added to a database but when I click the submit button submit.php appears blank which I assume means there has been some form of error. I can't find any errors myself, hoping someone can.
<?php
$con=mysqli_connect("localhost","tyler1996","Tylerkernick1996","essays");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql="INSERT INTO essays (author, email, essaytitle, subject, examboard, essay)
VALUES
('$_POST[author]','$_POST[subject]','$_POST[essaytitle]','$_POST[subject]','$_POST[examboard]','$_POST[essay]')";
if (!mysqli_query($con,$sql))
{
die('Error: ' . mysqli_error($con));
}
echo "1 record added";
mysqli_close($con);
?>