title: how do i display an alert box after inserting records into the database using javascript and php?
body: <p>The code below is able to insert into the database but doesn't display anything.</p>
  
  <p>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. </p>
  
  <p>I am a beginner and any help will be appreciated.</p>
  
  <pre><code>&lt;?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-&gt;query($sql) === true) {
  
          } else {
              echo "Error: " . $sql . "&lt;br&gt;" . $conn-&gt;error;
          }
  
      }
  
  
   }
   ?&gt;
  </code></pre>