title: Why mysqli executed prepared statement is not saving?
body: <p>I've just learning to use prepared statement in mysqli &amp; php. Here's the snippet of the code in question.</p>
  
  <pre><code>$stmt = $mysqli-&gt;prepare ("UPDATE courses set id=?, title=?, description=?, videourl=?, article=?, colcount=?, questiondisplayed=?, onfield=? WHERE id = ?");
  if ($stmt == false) { die ('prepare() failed: ' . htmlspecialchars($mysqli-&gt;error)); }
  $res = $stmt-&gt;bind_param("sssssiiis", $id, $title, $description2, $videourl, $article2, $colcount, $questiondisplayed, $onfield, $oldid);
  if ($res == false) { die ('bind_param() failed: ' . htmlspecialchars($mysqli-&gt;error)); }
  $res = $stmt-&gt;execute();
  if ($res == false) die ('execute() failed: ' . htmlspecialchars($mysqli-&gt;error));
  </code></pre>
  
  <p>The problem is, even after these codes run successfully (the die function never gets called), the database is not updated at all. But it's updated successfully if I'm not using prepared statement (construct the SQL query string manually). I want to convert from using manually constructed SQL query string into prepared statement. But I'm stuck in this area. Btw, the variables supplied in bind param have been set right before these codes run. I've run a <code>print_r ($_POST);</code> and it shows that my POST values are contain the right data. Where's the problem? Thanks.</p>