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());
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());