title: Capturing warning message from mysqli bind_params
body: <p>If you execute <code>mysqli_stmt-&gt;bind_params(...)</code> with an incorrect number of parameters, you get the following warning showing up in the browser:</p>
  
  <pre><code>Warning: mysqli_stmt::bind_param() [mysqli-stmt.bind-param]:
  Number of variables doesn't match number of parameters in prepared statement in ...
  </code></pre>
  
  <p>Fixing the coding problem is easy, but I'm not finding it easy to grab ahold of that warning myself in order to control how it's displayed (in the likely chance that I'll cause more warnings in the future). I'd like to:</p>
  
  <ul>
  <li>Suppress the warning being displayed automatically</li>
  <li>Grab ahold of the warning message and display it on my own terms</li>
  </ul>
  
  <p>Simply calling <code>@mysqli_stmt-&gt;bind_params(...)</code> seems to work for suppressing the default warning message being displayed. Is this the best approach?</p>
  
  <p>And the only information that I seem to get from <code>mysqli</code> is that the call to <code>mysqli_stmt-&gt;bind_params</code> returns <code>FALSE</code>. However, perhaps because this is a warning, there is no data in <code>mysqli-&gt;error</code> or <code>mysqli_stmt-&gt;error</code>. Accordingly, it is not clear to me where I can find the text for that message. Any ideas?</p>
  
  <p>Thanks.</p>