title: PHP form posting blank data in to mysql table
body: <p>I've created a form in order to post data in to a mysql database but when I submit the form it just enters blank data. I'm fairly new to PHP and mysql so if you can help using the simplest explanation, not assuming any great in depth knowledge that would be really appreciated.</p>
  
  <pre><code>    &lt;?php
  DEFINE('DB_USERNAME', 'root');
   DEFINE('DB_PASSWORD', 'root');
   DEFINE('DB_HOST', 'localhost');
   DEFINE('DB_DATABASE', 'users');
  
   $con = new mysqli(DB_HOST, DB_USERNAME, DB_PASSWORD, DB_DATABASE);
  
  if(!$con) {
  
      echo 'not connected to server';
  }
  
  if (!mysqli_select_db($con, 'users'))
  {
      echo 'no database selected';
  }
  
  $name = $_POST["name"];
  $email = $_POST["email"];
  $band = $_POST["band"];
  
  $sql = "INSERT INTO users (Names, Emails, BandName) VALUES ('$name', '$email', '$band')";
  
  if (!mysqli_query($con, $sql))
  
      {
  
      echo 'Not worked';
  
      } else {
  
      echo 'worked';
  
      }
  
  ?&gt;
  </code></pre>