title: Data not inserted in MySQL database, but there's no error
body: <p>First of all, I am new to the use of php, XAMPP and SQL. I put a lot of time in trying to solve this problem on my own but nothing I did solved it. </p>
  
  <p>I want to insert data from a input form on my website into my Database. When I fill out the form, the script runs without complaints but no data is inserted into my database. Also no errors shown in myphpadmin, simply 0 rows returned.</p>
  
  <pre><code>&lt;?php
  
  if (isset($_POST['submit'])) {
  
      include_once 'database.php';
  
      $first_name = mysqli_real_escape_string($conn, $_POST['first_name']);
      $last_name = mysqli_real_escape_string($conn, $_POST['last_name']);
      $username = mysqli_real_escape_string($conn, $_POST['username']);
      $password = mysqli_real_escape_string($conn, $_POST['password']);
      $pin = mysqli_real_escape_string($conn, $_POST['pin']);
  
      //Errors
      //Check for NOT NULL
      if (empty($first_name) || empty($last_name) || empty($username) || empty($password))
           {
          header("Location: ../signup.php?signup=empty");
          exit();
      } else {
          //check if input charakters are valid
          if (!preg_match("/^[a-zA-Z]*$/", $first_name) || !preg_match("/^[a-zA-Z]*$/", $last_name)) 
              {
                  header("Location: ../signup.php?signup=invalid");
                  exit();
              } else {
               $sql = "SELECT * FROM user WHERE username='$username'"; 
               $result = mysqli_query($conn, $sql);
               $resultCheck = mysqli_num_rows($result);
  
               if ($resultCheck &gt; 0) {
                  header("Location: ../signup.php?signup=usertaken");
                  exit();
                 } else {
                  //Hashing Password
                  $hashedpassword = password_hash($password, PASSWORD_DEFAULT);
                  //insert user into database
                  $sql = "INSERT INTO user (first_name, last_name, username, password, pin) VALUES ('$first_name', '$last_name', '$username', '$hashedpassword', '$pin');";
                  mysqli_query($conn, $sql);
                  header("Location: ../signup.php?signup=success");
                  exit();
                 }
              }
          }
  
  } else {
      header("location: ../signup.php");
      exit();
  }
  </code></pre>
  
  <p>the database is standard setup with root, localhost and no PW</p>
  
  <pre><code>&lt;?php
  
  $dbServername ="localhost";
  $dbUsername ="root";
  $dbPassword ="";
  $dbName ="ntust";
  
  $conn = mysqli_connect($dbServername, $dbUsername, $dbPassword, $dbName);
  
  ?&gt;
  </code></pre>
  
  <p>As I am also not very familiar with SQL, I start to wonder if the problem lies in my tables?</p>
  
  <pre><code>CREATE TABLE user (
  id Bigint(20) Primary Key auto_increment,
  username varchar(255) NOT NULL unique,
  pin varchar(6) NOT NULL,
  password varchar(255) NOT NULL,
  first_name varchar(255) NOT NULL,
  last_name varchar(255),
  last_modified_date datetime NOT NULL,
  created_date datetime NOT NULL
  );
  </code></pre>