title: How to resolve 'cannot pass parameter by reference' error in PHP?
body: <p>Here's my code:</p>
  
  <pre><code>$stmt = $conn-&gt;mysqli-&gt;prepare('INSERT INTO photos (CaseNo, ImageName, CaptureTime, UploadTime) VALUES (?,?,?,?)');
  $stmt-&gt;bind_param('isss', $caseno, $index.'.'.$extension, date('Y-m-d H:i:s'), date('Y-m-d H:i:s'));
  </code></pre>
  
  <p>I have tried this also:</p>
  
  <pre><code>$stmt = $conn-&gt;mysqli-&gt;prepare('INSERT INTO photos (CaseNo, ImageName, CaptureTime, UploadTime) VALUES (?,?,?,?)');
  $captureTime = date('Y-m-d H:i:s');
  $uploadTime = date('Y-m-d H:i:s');
  $stmt-&gt;bind_param('isss', $caseno, $index.'.'.$extension, $captureTime, $uploadTime);
  </code></pre>
  
  <p>I am getting the error:  </p>
  
  <blockquote>
    <p>Fatal error:** Cannot pass parameter 3 by reference in **...file path...line #</p>
  </blockquote>
  
  <p>Please note that <strong>CaptureTime</strong> and <strong>UploadeTime</strong> have datatype <strong><em>date</em></strong>. And ignore the fact that I am passing the value of 3rd and 4th parameter same.</p>
  
  <p>What's wrong with the code?</p>