title: mysqli prepare for update query failed
body: <p>The following code fails on prepare:</p>
  
  <pre><code>$query = "UPDATE `table` SET `col` = ? WHERE `id` = ?";
  if (!($stmt = $mysqli-&gt;prepare($query))) {
      echo "Prepare failed: (" . $mysqli-&gt;errno . ") " . $mysqli-&gt;error;
  }
  //^^^ PREPARE fails
  $stmt-&gt;bind_param("si", $val,$id);
  if (!$stmt-&gt;execute()) {
      echo "Execute failed: (" . $stmt-&gt;errno . ") " . $stmt-&gt;error;
  }
  </code></pre>
  
  <p>I get this: Warning: mysqli::prepare() [mysqli.prepare]: Couldn't fetch mysqli...
  What am I doing wrong in the code above?
  I checked the syntax documentation, but if I try to pas the query as an sql I do get a syntax error. Is there a good debugging tool for mysqli syntax errors?</p>