title: How do I catch a PHP mysqli_stmt error?
body: <p>I want to catch mysqli_stmt errors like following pseudocode:</p>
  
  <pre><code>&lt;?php
  include 'db.php';
  
  try{
     $stmt=$db-&gt;prepare('INSERT INTO test(test_1, test_2) VALUES (?, ?)');
     $stmt-&gt;bind_param("is", $example_variable1, $example_variable2);
     $stmt-&gt;execute();
     $stmt-&gt;close();
     echo 'data inserted successful, everything ok!';
  }catch(mysqliError $e){
     echo 'please retry later!';
  }
  </code></pre>
  
  <p>How can I do something like this?</p>