npsari Posted April 26, 2008 Share Posted April 26, 2008 Hello guys, How can subtract time I want to write (if time passed is less that 30 seconds,) how can i write that i did it this way time_message< '30' but seems wrong My code: $tim = localtime(time(),true); $Time=($tim['tm_hour'].":".$tim['tm_min'].":".$tim['tm_sec']); $qT = "SELECT * FROM message WHERE SENDER_PROFILE='$sender_id' AND profile_message='$sent_to_id' AND time_message< '30' "; $rT = @mysql_query($qT,$con); if(mysql_num_rows($rT)>0){ /// ---------> TO DISABLE CLICKING REFRESH 1000000 TIMES print"Why sending it 2 times, there is no need!"; }else{ /// ---------> TO DISABLE CLICKING REFRESH 1000000 TIMES print"Message sent!"; } /// ---------> TO DISABLE CLICKING REFRESH 1000000 TIMES Because i dont want the same message to be sent in 30 seconds Link to comment https://forums.phpfreaks.com/topic/103002-people-who-click-refresh-send-1000-messages/ Share on other sites More sharing options...
beansandsausages Posted April 26, 2008 Share Posted April 26, 2008 i dont think it would be : time_passes < 30 would have to be the unix time stamp i assume, dont hold me to that though. Link to comment https://forums.phpfreaks.com/topic/103002-people-who-click-refresh-send-1000-messages/#findComment-527647 Share on other sites More sharing options...
npsari Posted April 26, 2008 Author Share Posted April 26, 2008 hmm, maybe if i say $qT = "SELECT * FROM message WHERE SENDER_PROFILE='$sender_id' AND profile_message='$sent_to_id' AND (time_message - $Time < '30') "; Link to comment https://forums.phpfreaks.com/topic/103002-people-who-click-refresh-send-1000-messages/#findComment-527651 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.