tjhilder Posted April 1, 2006 Share Posted April 1, 2006 I've created an online users script, the inserting and updating works fine, just need to delete the entries that are inactive before 5 minutes ago.here's my code.[code]$delete_lookup = "DELETE FROM v3_usersonline WHERE time='<= " . $five . "'";if (!$delete_lookup_result = mysql_query($delete_lookup)){ echo "nothing deleted because : " . mysql_error() . " the query was: " . $delete_lookup;}else{ echo "";}[/code] Quote Link to comment https://forums.phpfreaks.com/topic/6313-delete-where-time-5-minutes-ago/ Share on other sites More sharing options...
wickning1 Posted April 1, 2006 Share Posted April 1, 2006 DELETE FROM v3_usersonline WHERE time < NOW() - INTERVAL 5 MINUTE Quote Link to comment https://forums.phpfreaks.com/topic/6313-delete-where-time-5-minutes-ago/#findComment-22824 Share on other sites More sharing options...
tjhilder Posted April 1, 2006 Author Share Posted April 1, 2006 thanks for your help, i've managed to fix it. Quote Link to comment https://forums.phpfreaks.com/topic/6313-delete-where-time-5-minutes-ago/#findComment-22887 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.