title: PHP mysqli_stmt_execute() error
body: <p>I am getting the following errors when I attempt to submit my form:</p>
  
  <pre><code>Warning: mysqli_stmt_execute() expects parameter 1 to be mysqli_stmt, boolean given in                 /Applications/MAMP/htdocs/phpv1/v1/editprofilephp.php on line 66
  
  Warning: mysqli_stmt_affected_rows() expects parameter 1 to be mysqli_stmt, boolean given in /Applications/MAMP/htdocs/phpv1/v1/editprofilephp.php on line 68
  Error Occurred
  
  Warning: mysqli_error() expects exactly 1 parameter, 0 given in /Applications/MAMP/htdocs/phpv1/v1/editprofilephp.php on line 83
  
  Warning: mysqli_stmt_close() expects parameter 1 to be mysqli_stmt, boolean given in /Applications/MAMP/htdocs/phpv1/v1/editprofilephp.php on line 85
  </code></pre>
  
  <p>I have checked all of the other posts with the same error and I have not made any of the mistakes mentioned in those.</p>
  
  <p>My PHP is:</p>
  
  <pre><code>&lt;?php 
  session_start();
  
  if(isset($_POST['submit'])){
  
  
  
  $data_missing = array();    
  
  if(empty($_POST['aboutme'])){
  
      // Adds name to array
      $data_missing[] = 'aboutme';
  
  } else {
  
      // Trim white space from the name and store the name
      $aboutme = trim($_POST['aboutme']);
  
  }
  
  if(empty($_POST['full_name'])){
  
      // Adds name to array
      $data_missing[] = 'full_name';
  
  } else {
  
      // Trim white space from the name and store the name
      $full_name = trim($_POST['full_name']);
  
  }
  
  if(empty($_POST['friend'])){
  
      // Adds name to array
      $data_missing[] = 'friend';
  
  } else {
  
      // Trim white space from the name and store the name
      $friend = trim($_POST['friend']);
  
  }
  
  
  
  
  
      if(empty($data_missing)){
      $id = $_SESSION["user_id"];    
  
      require_once('mysqli_connect.php');
  
      $query = "UPDATE userprofile SET full_name='{$full_name}' aboutme='{$aboutme}'  friend='{$friend}' WHERE id='{$id}' LIMIT 1";
  
      $stmt = mysqli_prepare($dbc, $query);
  
  
      //i Interger
      //d Doubles         
      //s Everything Else
  
  
  
      mysqli_stmt_execute($stmt);
  
      $affected_rows = mysqli_stmt_affected_rows($stmt);
  
      if($affected_rows == 1){
  
          echo 'Student Entered';
  
  
  
          mysqli_stmt_close($stmt);
  
          mysqli_close($dbc);
  
      } else {
  
          echo 'Error Occurred&lt;br /&gt;';
          echo mysqli_error();
  
          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;";
  
      }
  
  }
  
  }else {
  echo mysqli_error();
  }         
  
  ?&gt;        
  </code></pre>
  
  <p>I have used this code before in previous sections of the website for different purposes and I have not had any problems. I have spent a long time trying to locate the error and had no success, so I decided to ask here.</p>