title: Adding user to MySQL database in php using phpMyAdmin
body: <p>I think I am successfully connecting to my database by:</p>
  
  <pre><code>&lt;?php
      $user = 'root';
      $pass = '9KSroMDjEqNmEYY4';
      $db = 'chatservice';
      $host = '127.0.0.1';
  
      $conn = new mysqli($host, $user, $pass, $db, 3306) or die("Unable to connect");
      if ($conn-&gt;connect_error){
          die("Connection failed: " . $conn-&gt;connect_error);
      }
  ?&gt;
  </code></pre>
  
  <p>My question is how I would use the registration code to successfully add a user to the database. When entering the form I press register I do not get any error messages stating that the registration didn't succeed. It seems that the php code is not being reached after the initial connection. I am new to php and mySQL so any tips on formatting would be nice too!</p>
  
  <pre><code>&lt;?php
      require('connect.php');
      if(isset($_POST['user']) &amp;&amp; isset($_POST['password'])){
          $user = $_POST['user'];
          $id = $_POST['IDNUM'];
          $password = $_POST['password'];
  
          $query = "INSERT INTO 'users' (user ,IDNUM ,password) VALUES('$user', '$id', '$password')";
          $result = mysqli_query($query);
          if($result){
              $msg = "Registered Sussecfully";
              echo $msg;
          }
          else
              $msg = "Error Registering";
              echo $msg;
      }
  ?&gt;
  
  
  &lt;div class="register-form"&gt;
      &lt;title&gt;Chat Page Start&lt;/title&gt;
      &lt;form action="" methods="POST"&gt;
          &lt;p&gt;
          &lt;label&gt;Username: &lt;/label&gt;
          &lt;input id="user" type="text" name="user" placeholder="user" /&gt;
          &lt;/p&gt;
  
          &lt;p&gt;
          &lt;label&gt;ID: &lt;/label&gt;
          &lt;input id="IDNUM" type="text" name="IDNUM" placeholder="ID number" /&gt;
          &lt;/p&gt;
  
          &lt;p&gt;
          &lt;label&gt;Password: &lt;/label&gt;
          &lt;input id="password" type="password" name="password" placeholder="password" /&gt;
          &lt;/p&gt;
  
          &lt;a class="btn" href="login.php"&gt;Login&lt;/a&gt;
          &lt;input class="btn register" type="submit" value="Register" /&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Another thing is how would I check the status of my database connection and where I should be checking this status?</p>