title: Prepared statements and bind_param error handling
body: <p>In the following php code with prepared statements is intentionally caused an error to test bind_param and execute, adding $bikes.</p>
  
  <p>In the execute function the error information is returned; however, in bind_param, although an error occurs, it does not return any error information.</p>
  
  <p>How to get error information in bind_param?</p>
  
  <pre><code>$sqlQuery = "INSERT INTO the_cars (cars) VALUES (?)";
  
  if($statement = $con-&gt;prepare($sqlQuery)){
  
      if(!$statement-&gt;bind_param("s", $cars, $bikes)){ //bikes should not be here
          $errors = $statement-&gt;error; //error is empty
      };
  
      if(!$statement-&gt;execute()){
          $errors1 = $statement-&gt;error; // error: No data supplied for parameters in prepared statement
      };
  
  }else{    
      $errors = $con-&gt;error;
  }
  </code></pre>
  
  <p><strong>EDITED:</strong></p>
  
  <p>The PHP manual seems to suggest that in bind_param the error should be handled. 
  See the following part of the text: Example #3 INSERT prepared once, executed multiple times » /* Prepared statement, stage 2: bind and execute */</p>
  
  <p><a href="http://php.net/manual/en/mysqli.quickstart.prepared-statements.php" rel="nofollow noreferrer">http://php.net/manual/en/mysqli.quickstart.prepared-statements.php</a></p>
  
  <p>This also seems to be the position advocated in some posts. For example:</p>
  
  <p><a href="https://stackoverflow.com/questions/2552545/mysqli-prepared-statements-error-reporting">MySQLi prepared statements error reporting</a></p>
  
  <p>However, I made several attempts, and I was never able to get a description of a statement error in bind_param.</p>