title: Catching mysql errors from php
body: <p>I tried to catch all kind of possible errors from a database function. My code won't work for me, so maybe I think there is a error inside or i misunderstood something.</p>
  
  <p>That's what i have</p>
  
  <pre><code>$appDB = new mysqli('localhost', '12344', '123456', '123456');
  if ($appDB-&gt;connect_error) { die("Connection appDB failed: " . $appDB-&gt;connect_error); } 
  
  $result = $appDB-&gt;query($query[0].' '.$table.' '.$query[1])
      or die (mysql_error().'\nAdditional Infos: $appDB-&gt;query('.$query[0].' '.$table.' '.$query[1].'); --&gt; Result:'.$result);
  </code></pre>
  
  <p>That won't work - I get no errors, what I do wrong in this case?</p>
  
  <p>Hope someone can explain what my error about the code is.</p>