This is the code in my PHP script on a very basic html page with a form. I have tried every possible variation of single quotes, double, single and double for the values. I didn't get any response at all. I have tested to make sure the connection is made, but nothing is inserted in the DB. I just don't know what I'm doing wrong.
// Check our connection
if (mysqli_connect_errno($con)) {
print_r("Connect failed: %s\n", mysqli_connect_error());
exit();
}
if(isset($_POST["submit"])){
$name = $_POST['name'];
$company = $_POST['company'];
$email = $_POST['email'];
$comment = $_POST['comment'];
// Insert our data
$query = mysqli_query("INSERT INTO 'contacts' ('id','name', 'company', 'email', 'comment') VALUES ('','$name', '$company', '$email', '$comment')", $con);
$result = ($query);
if( $result )
{
print_r('Success');
}
else
{
print_r('Query Failed');
}
mysqli_close($con);
}