title: PHP update timestamp in MySQL table via PHP function
body: <p>Thanks for the help, in advance. I'm new to PHP so please bear with me.</p>
  
  <p>I have the following <code>foreach</code> loop:</p>
  
  <pre><code>1 foreach($killOrder as $k){
  2     $toTime = strtotime($k['timediff']);
  3     $fromTime = strtotime("now");
  4     if (($fromTime - $toTime) &gt; 5400){
  5         $db-&gt;update_order($k, array('orderfulfilled_ts'=&gt;date('Y-M-d H:i:s')));
  6     } else {
  7         echo '&lt;p&gt;still time&lt;/p&gt;';
  8     }
  9 }   
  </code></pre>
  
  <p>The array $killOrder contains ID=>1234 timediff=>0000-00-00 00:00:00</p>
  
  <p>If you look at line 5, its currently updating a column <code>orderfulfilled_ts</code> in a table with the current time stamp. What I would like it to do is update <code>orderfulfilled_ts</code> with the time stamp from <code>$killOrder['timediff']</code>.</p>
  
  <p>The function update_order is:</p>
  
  <pre><code>function update_order($id, $args) {
      return $this-&gt;update_row(REGION_PREFIX."Order", $id, $args);
  }
  </code></pre>
  
  <p>So I'm not sure if I should be saving <code>$killOrder['timediff']</code> in a variable first and then formatting it to pass or if there is a better way to achieve this.</p>