title: Turning query errors to Exceptions in MySQLi
body: <p>I'm trying to turn MySQLi query errors to Exceptions, but couldn't - <a href="http://php.net/manual/en/class.mysqli-sql-exception.php" rel="noreferrer">mysqli_sql_exception</a> is thrown only if it failed to connect the DB.</p>
  
  <p>I used <code>mysqli_report(MYSQLI_REPORT_STRICT)</code> and procedural MySQLi functions embedded to custom wrapper class.</p>
  
  <p><strong>Former code:</strong></p>
  
  <pre><code>public function mysqlQuery($SQL) {
  
      $this-&gt;Result = mysqli_query($this-&gt;DBlink, $SQL);
  
      if($this-&gt;Result === false)
          throw new MySQLiQueryException($SQL, mysqli_error($this-&gt;DBlink), mysqli_errno($this-&gt;DBlink));
  
      return $this-&gt;Result;
  
  }
  </code></pre>
  
  <p><strong>Question:</strong> Is it normal no Warning, nor Exception are thrown when query fails so I have to check if mysqli_query() returned false?</p>