title: Php form not sending input to the database and not showing print_r
body: <p>So i have this code which is supposed to send name and email address to the database. Not only is it not doing that, but in my second line of code where I want it to print_r whatever has been entered I still get a blank screen. Is there a setting to show what errors are occurring in my code that I've got turned off or is this code wrong?</p>
  
  <pre><code>//Only process the form if $_POST isn't empty
  if(! empty($_POST)){
      print_r($_POST); exit;
  
  
  //Connect to MYSQL
      $mysqli = new mysqli('localhost', 'root','','snippets');
  
  //Check connection
      if($mysqli -&gt;connect_error){
          die('Connect Error: '. $mysqli-&gt;connect_errno . ': ' . $mysqli-&gt;connect_error);
      }
  
  //Insert data
      $sql = "INSERT INTO user(name, email) VALUES ('{$mysqli-&gt;real_escape_string($_POST['name'])}','{$mysqli-&gt;real_escape_string($_POST['email'])}' )";
      $insert = $mysqli-&gt;query($sql);
  
  //Print reponse from MySQL
      if($insert){
          echo "Success! Row ID: {$mysqli-&gt;insert_id}";
      }else{
          die("Error: {$mysqli-&gt;errno}:{$mysqli-&gt;error}");
      }
  
  //Close connection
      $mysqli -&gt;close();
  }
  ?&gt;
  &lt;form method="post" action=""&gt;
      &lt;input name="name" type="text"&gt;
      &lt;input name="email" type="email"&gt;
      &lt;input type="submit" value="Submit Form"&gt;
  &lt;/form&gt;
  </code></pre>