title: Insert data into mySQL table, using POST and Server Request Method
body: <p>I have a simple question, I hope I can finally do it .. I already created a database ("our_new_database"), I checked it in XAMPP, everything is fine, also I created credentials, a working connection, a HTML form and a table.</p>
  
  <p>Now I have to insert information from the form (First Name, Second Name, Email) into the table, but first I must set 3 variables with NULL values and AFTER that to include them in IF/ELSE statement using <code>$_POST</code>.</p>
  
  <p>The point is - user is entering information to the database, then his info is coming via <code>$_POST</code>request and inserting into the table. And this is where I can't proceed by myself, will be very happy if you help me.</p>
  
  <p>This is the HTML Form:</p>
  
  <pre><code>&lt;form action="" method="post"&gt;
      &lt;p&gt;
          &lt;label for="userNameOne"&gt;User First Name:&lt;/label&gt;
          &lt;input type="text" name="userOne" id="userNameOne"&gt;
      &lt;/p&gt;
      &lt;p&gt;
          &lt;label for="userNameTwo"&gt;User Second Name:&lt;/label&gt;
          &lt;input type="text" name="userTwo" id="userNameTwo"&gt;
      &lt;/p&gt;
      &lt;p&gt;
          &lt;label for="userEmail"&gt;Email Address:&lt;/label&gt;
          &lt;input type="email" name="userEmail" id="user_Email"&gt;
      &lt;/p&gt;
      &lt;input type="submit" value="submit" name="submit"&gt;
  </code></pre>
  
  <p>This is the credentials + database connection + creating the table:</p>
  
  <pre><code>&lt;?php
  
  session_start();
  
  $host = "localhost";
  $user_name = "root";
  $user_password = "";
  $dbname = "our_new_database";
  
  function db_connect($host, $user_name, $user_password, $dbname) {
      $connection = mysqli_connect($host, $user_name, $user_password, $dbname);
      if(mysqli_connect_errno()){
          die("Connection failed: ".mysqli_connect_error());
      }
      mysqli_set_charset($connection, "utf8");
      return $connection;
  }
  
  include "app".DIRECTORY_SEPARATOR."config.php";
  include "app".DIRECTORY_SEPARATOR."db-connection.php";
  include "app".DIRECTORY_SEPARATOR."form.php";
  
  $foo_connection = db_connect($host, $user_name, $user_password, $dbname);
  
  $sql = "CREATE TABLE user_info(
      user_name_one VARCHAR(30) NOT NULL,
      user_name_two VARCHAR(30) NOT NULL,
      user_email VARCHAR(70) NOT NULL UNIQUE
  )";
  
  if(mysqli_query($foo_connection, $sql)){
      echo "Table created successfully";
  }
  else {
      echo "Error creating table - table already exist.".mysqli_connect_error($foo_connection);
  }
  $foo_connection-&gt;close();
  </code></pre>
  
  <p>As I said, where I need to set up these NULL variables, and how to put them in IF/ELSE Statement, to get the <code>$_POST</code> request from the form and insert it into the table?</p>