title: MySQLi prepared statements error reporting
body: <p>I'm trying to get my head around MySQli and I'm confused by the error reporting.
  I am using the return value of the MySQLi 'prepare' statement to detect errors when executing SQL, like this:</p>
  
  <pre><code>$stmt_test =  $mysqliDatabaseConnection-&gt;stmt_init();
  if($stmt_test-&gt;prepare("INSERT INTO testtable VALUES (23,44,56)"))
  {
   $stmt_test-&gt;execute();
   $stmt_test-&gt;close();
  }
  else echo("Statement failed: ". $stmt_test-&gt;error . "&lt;br&gt;");
  </code></pre>
  
  <p>But, is the return value of the prepare statement only detecting if there is an error in the preperation of the SQL statement and not detecting execution errors? If so should I therefore change my execute line to flag errors as well like this:</p>
  
  <pre><code>if($stmt_test-&gt;execute()) $errorflag=true;
  </code></pre>
  
  <p>And then just to be safe should I also do the following after the statement has executed:</p>
  
  <pre><code>if($stmt_test-&gt;errno) {$errorflag=true;}
  </code></pre>
  
  <p>...Or was I OK to start with  and the return value on the MySQLi prepare' statement captures all errors associated with the complete execution of the query it defines?</p>
  
  <p>Thanks 
  C</p>