title: php - mysqli prepare statement error - procedure style
body: <p>I just read <a href="https://stackoverflow.com/questions/2552545/mysqli-prepared-statements-error-reporting">this</a> it explains clearly for object oriented style error handling.</p>
  
  <p><a href="http://php.net/manual/en/mysqli-stmt.error.php" rel="nofollow noreferrer">This</a> page also explains the same.</p>
  
  <p>I want to know how to find whether a prepared statement fails, and what is the error.</p>
  
  <pre><code>$stmt = mysqli_prepare(ConnectionObject,Query);
  if($stmt == false)
  {
      // Found statement fails
      // How to find what is the error
      // mysqli_stmt_error($stmt); It will fail because $stmt is boolean[false].
  }
  </code></pre>
  
  <p>How to find the exact error?</p>