I am new to PHP and I am making a insert function which will insert the html input into my Sql database but at the moment when I submit nothing happens and no information is entered into the database. Any help on how I can get the in-putted information to submit to the database would be greatly appreciated.
<html>
<head>
</head>
<body>
  <div align = "center">
           <form method = "POST" class="basic-grey">
           <h1><i>Insert</i></h1>
              <label>Title  :<input type = "text" name="title"/></label>
              <label>Content  :<input type = "text" name="content"/></label>
              <label>User  :<input type = "text" name="user"/></label>
              <label><input type = "submit" value = "submit"/></label>
           </form> 
           <div style = "font-size:11px; color:#cc0000; margin-top:10px"><?php echo $error ?></div>
           </div>
</html>
<?php
include_once 'db_config.php';
session_start();
if (!(isset($_SESSION['login_user']) && $_SESSION['login_user'] != '')) {
header ("Location: login2.php");
 }
if(isset($_POST["submit"])) {
$title = $_POST['title'];
$content = $_POST['content'];
$user = $_POST['user'];
$sql = "INSERT INTO 'diary' ('ID', 'TITLE', 'CONTENT', 'USER') 
VALUES (NULL, '$title','$content', '$user',)";
if ($conn->query($sql) === TRUE) {
header("location: results.php");
 } else {
 echo "Error: " . $sql . "<br>" . $conn->error;
}
}
$conn->close();
?>
 
     
     
     
     
    