title: MySQL update DATETIME to NOW() using PHP
body: <p>This all worked before I added the section to update "last_update". </p>
  
  <pre><code>if((time() - $last_update) &gt; 7200){
  $sql = $dbh-&gt;prepare("UPDATE item_list SET quantity=:quantity, price=:price, last_update=:now WHERE item_name=:itemname");
                  $sql-&gt;bindParam(':quantity', $json-&gt;volume);
                  $sql-&gt;bindParam(':price', $json-&gt;lowest_price);
                  $sql-&gt;bindParam(':itemname', $row['Item_Name']);
                  $sql-&gt;bindParam(':now', "NOW()");  //This doesn't work
                  $sql-&gt;execute();
  }
  </code></pre>
  
  <p>When this is called I want to make last_update the date and time now. In the database it is currently a DATETIME, and when I last_update I origianly set them to NOW();</p>
  
  <p>Doing this I get the error <strong>Fatal error: Cannot pass parameter 2 by reference in.... Directory</strong></p>
  
  <p>I know it expects a variable, I'm not sure how to fix it though. I tried setting </p>
  
  <p><code>$now = "NOW()"; 
   $sql-&gt;bindParam(':now', $now);</code> </p>
  
  <p>No prevail. Any help?</p>