title: How to display query error in php
body: <p>I have a mysqli query that wont execute and I would like to display information about why that's happening. Im just fooling around with this example but I imagine something like this:</p>
  
  <pre><code>$myQuery= $mysqli-&gt;query("UPDATE table SET id = 1 WHERE id = 3");
  if(!$myQuery) //If query couldnt be executed
  {
  echo $mysqli-&gt;error; //Display information about why wasnt executed (eg. Error: couldnt find table)
  }
  </code></pre>