title: Cant INSERT INTO database with PHP, No errors thrown
body: <p>Okay so I am using PHP and I need the contents of a text box to be put into the table of my DB and when I click submit not errors are thrown but nothing is put in the DB here is my code:</p>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;html&gt;
  &lt;title&gt;Chat App&lt;/title&gt;
  &lt;head&gt;
      &lt;link rel="stylesheet" type="text/css" href="chatCSS.css"&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div class="logOut"&gt;
          &lt;form action="loggedOut.php" method="POST"&gt;
              &lt;input type="submit" value="Log Out"&gt;
          &lt;/form&gt;
      &lt;/div&gt;
      &lt;div class="incomeMessages"&gt;
          &lt;input type="text" id="incomeMessageBox" disabled="disabled"&gt;
          &lt;br&gt;
          &lt;br&gt;
          &lt;form method="POST" action="index.php"&gt;
              &lt;input type="text" name="message" id="myMessage" placeholder="Message here..."&gt;
              &lt;input type="submit" id="myMessageSubmit"&gt;
          &lt;/form&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>PHP:</strong></p>
  
  <pre><code>&lt;?php
  require 'includes/connect_mysql.php';
  require 'includes/sessionCheck.php';
  
  if ($_SERVER['REQUEST_METHOD'] == 'POST') {
      $message = $_POST['message'];
      $time = time();
      $user = $_SESSION['activeUser'];
  
      if ($db_connect) {
          $SQL = "INSERT INTO mainconversation (Name, Message, Time) VALUES ('$user', '$message', '$time')";
  
          $result = mysqli_query($connection, $SQL);
          mysqli_close($connection);
      }
  
  }
  
  ?&gt;
  </code></pre>
  
  <p><strong>CONNECTION CODE:</strong></p>
  
  <pre><code>&lt;?PHP
  
  $db_host = "localhost"; 
  
  $db_username = "xxxx";  
  
  $db_pass = "xxxxxxxx";  
  
  $db_name = "chatapp"; 
  
  
  $connection = mysqli_connect("$db_host","$db_username","$db_pass") or die ("could not connect to mysql");
  $db_connect = mysqli_select_db($connection, "$db_name") or die ("no database");  
  
  ?&gt;
  </code></pre>