The code below is able to insert into the database but doesn't display anything.
I tried playing around with the code using JavaScript and AJAX though I only have basic understanding of the two and wasn't able to change anything.
I am a beginner and any help will be appreciated.
<?php
require_once 'connect.php';
if (isset($_POST['submit']))
{
{
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$message = $_POST['message'];
$sql = "INSERT INTO message (Names, Email, Numbers,Message)
VALUES ('$name','$email','$phone','$message')";
echo"Record Enterd";
if ($conn->query($sql) === true) {
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
}
}
?>