I've written out the following, but it returns a syntax error near the bolded portion. I don't see anything wrong with the syntax, but I'm sure theres something I missed. The script is supposed to scan the table to see if you have attacked your current target player 3 times in the last hour.
$q = mysql_query("SELECT COUNT(*) AS count FROM attack WHERE attacker_id = $AttackerId AND
defender_id = $AttackedID AND
attacktime BETWEEN DATE_SUB(NOW(), INTERVAL 1 HOUR) AND NOW()") or die(mysql_error());
$row = mysql_fetch_array($q) or die(mysql_error());
if($row['count'] == 3){
die("You have already attacked this person 3 times this hour.");