hi , im inserting timestamp into mysql table, i have forgotten how to check if the limit is up 🙁
$timestamp = time(); $timeoutseconds = 300; $timeout = $timestamp-$timeoutseconds;
have that but thats all 🙂 its late , im sleepy , thank you
Timeout? You mean... script execution timeout? Or are you checking a timestamp in a MySQL table and comparing it to another timestamp? Please clarify what you're doing for me.
yes just comparing/checking mysql timestamp so basically if the user has posted again before 300 seconds for example i can stop the script process and end it early 🙂
you know what i mean right ? 🙂
For the hypothetical MySQL table "myTable" with structure:
bob | 110312523248
You would check by using code such as:
$query = "SELECT last_time FROM myTable WHERE username='$username'"; $result = mysql_query($query); $old_time = mysql_result($query, 0); if( $old_time > (time()-3600) ) { // Not enough time has passed } else { // Enough time has passed }