Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42215

Check timestamp is over 5 minutes ago?

$
0
0
Hi guys, does anybody know a way of only inserting the same thing into the database if they are 5 minutes apart? For example :

Jamie Warren listened to Capital FM - goes in at 12:06pm

but if i then if i refresh the page it adds the record again but with a different time stamp, is there a way to only add the same record if the timestamps are over 5 minutes apart?


$time = time();
$sql_insert1 = "INSERT into `activity`
(`username`,`activity`,`time`,`type`
)
VALUES
('$id','$text','$time','broadcast'

)
";


mysql_query($sql_insert1) or die("Insertion Failed:" . mysql_error());

Viewing all articles
Browse latest Browse all 42215

Trending Articles