title: Warning: mysqli_stmt_bind_param() expects parameter 1 to be mysqli_stmt, boolean given in
body: <pre><code>&lt;?php
  
  if(isset($_POST['submit'])){
  
      $data_missing = array();
  
      if(empty($_POST['first_name'])){
  
          // Adds name to array
          $data_missing[] = 'First Name';
  
      } else {
  
          // Trim white space from the name and store the name
          $f_name = trim($_POST['first_name']);
  
      }
  
      if(empty($_POST['last_name'])){
  
          // Adds name to array
          $data_missing[] = 'Last Name';
  
      } else{
  
          // Trim white space from the name and store the name
          $l_name = trim($_POST['last_name']);
  
      }
  
      if(empty($_POST['email'])){
  
          // Adds name to array
          $data_missing[] = 'Email';
  
      } else {
  
          // Trim white space from the name and store the name
          $email = trim($_POST['email']);
  
      }
  
  
  
      if(empty($_POST['birth_date'])){
  
          // Adds name to array
          $data_missing[] = 'Birth Date';
  
      } else {
  
          // Trim white space from the name and store the name
          $b_date = trim($_POST['birth_date']);
  
      }
  
      if(empty($_POST['sex'])){
  
          // Adds name to array
          $data_missing[] = 'Sex';
  
      } else {
  
          // Trim white space from the name and store the name
          $sex = trim($_POST['sex']);
  
      }
  
  
      if(empty($data_missing)){
  
          require_once('database.php');
  
          $query = "INSERT INTO etable (first_name, last_name, email,
           birth_date, sex) VALUES (?, ?, ?,
          ?, ?, ?)";
  
          $stmt = mysqli_prepare($dbc, $query);
  
          mysqli_stmt_bind_param($stmt, "ssssss", $f_name,
                                 $l_name, $email, $b_date,
                                 $sex);
  
          mysqli_stmt_execute();
  
          $affected_rows = mysqli_stmt_affected_rows();
  
          if($affected_rows == 1){
  
              echo 'Student Entered';
  
              mysqli_stmt_close($stmt);
  
              mysqli_close($dbc);
  
          } else {
  
              echo 'Error Occurred&lt;br /&gt;';
              echo mysqli_error($dbc);
  
              mysqli_stmt_close($stmt);
  
              mysqli_close($dbc);
  
          }
  
      } else {
  
          echo 'You need to enter the following data&lt;br /&gt;';
  
          foreach($data_missing as $missing){
  
              echo "$missing&lt;br /&gt;";
  
          }
  
      }
  
  }
  
  ?&gt;
  </code></pre>