title: Why does this UPDATE prepared statement doesn't work, but works when used in SQL db
body: <p>I have the following statement:</p>
  
  <pre><code>$stmt = $con-&gt;prepare("UPDATE accounts SET loggedin = ? WHERE TIMESTAMPDIFF(SECOND,lastcheck, NOW()) &gt;= ? AND loggedin = ?");
  $stmt-&gt;bind_param('iii', 0, 61, 0);
  </code></pre>
  
  <p>And it gives <code>500 internal server error</code>. When I tried the same on phpmyadmin running the sql thing like this:</p>
  
  <pre><code>UPDATE accounts SET loggedin = 0 WHERE TIMESTAMPDIFF(SECOND,lastcheck, NOW()) &gt;= 61 AND loggedin = 1
  </code></pre>
  
  <p>Worked without any problems.</p>
  
  <p>Where is my problem?</p>
  
  <p>Here's my error:</p>
  
  <blockquote>
    <p>PHP Fatal error: Uncaught Error: Cannot pass parameter 2 by reference</p>
  </blockquote>