title: post throttling using php mysql and an epoch timestamp not functioning
body: <p>I'm trying to throttle posts by users via php, mysql, and an epoch timestamp in my database stored in the row <code>timestamp</code> (ex: <code>1406059107</code>). </p>
  
  <p>My script executes as intended the first time and throttles the user for 60 seconds, but after that I can literally flood the server with posts since the throttling stops functioning. </p>
  
  <p>I tried using <code>ASC</code> instead of <code>DESC</code> without success.</p>
  
  <pre><code>$sql = "SELECT timestamp FROM phpbb_schedule WHERE username = " . (int) $user-&gt;data['user_id'] . " ORDER BY timestamp DESC";
  
  $result = $db-&gt;sql_query_limit($sql, 1);
  $row = $db-&gt;sql_fetchrow($result);
  $db-&gt;sql_freeresult($result);
  
  if (time() - $row['timestamp'] &lt; 60)
  {
      header( 'Location: someurl.php' );
      die ('Your can only input one request every 60 seconds.');
  }
  else
  {
      echo 'success some other code goes here that inputs the data into the db and redirects this to another page';
  }
  </code></pre>
  
  <blockquote>
    <p>Note: The issue has been resolved I didn't use <code>ORDER by timestamp</code> and a syntax error had occurred (see comments). </p>
  </blockquote>