$result = mysql_query('select count(*) from antiabuse where `ts` > curtime() - interval 1 hour'); $row = mysql_fetch_row($result); $count = $row[0]; if ($count > 250) { die('Sorry, please wait and try again in a few minutes.'); }