title: MySQL date comparison from PHP
body: <p>I would very much appreciate your help.</p>
  
  <p>I have a mysql db that contains a Datetime field. In that field I have a particular date and time,
  for example:</p>
  
  <pre><code>2013-10-03 22:28
  </code></pre>
  
  <p>I then have a PHP script that gets a particular date and time from the <code>$_GET</code> command, values separately: year, month, day, hour, minute.</p>
  
  <p>From this GET I created a Date as follows:</p>
  
  <pre><code>$datum = $year."-".$month."-".$day." ".$hour.":".$minute.":".$seconds;
  $date = date('Y-m-d H:i',strtotime($datum));
  </code></pre>
  
  <p>What I need to do now is somehow compare this new date I created with the last date value in the database (the most recent). The point is that after I compare this I want to check whether the last value in the db is older than 5 minutes and only then do a particular action (insert new row), and if the last date in the db is newer than 5 minutes, do nothing.</p>