Jump to content

Recommended Posts

hi, i was wondering if anyone had a code that i could have for when a database entry gets entered, it will remove itself after 3 hours?

 

i have a page where someone creates a question and it currently takes a timestamp. i would like to put in my page where you view the questions the code to check all timestamps in the table, and remove any that are older than 3 hours.

 

table is called 'findamatch' table is called 'timestamp'

 

thanks.

Link to comment
https://forums.phpfreaks.com/topic/150209-php-help/
Share on other sites

i tried this... didnt work:

 

$fam=mysql_query("SELECT id,clan,rules,month,day4,year,hour,min,ampm,timezone,teamid,ladder,maxbet,aim,email,yim,timestamp FROM findamatch ORDER BY timestamp");
while(list($id,$clan,$rules,$month,$day4,$year,$hour,$min,$ampm,$timezone,$teamid,$ladder,$maxbet,$aim,$email,$yim,$timestamp)=mysql_fetch_row($fam)){


$deleterow=$timestamp;
mysql_query("DELETE FROM findamatch WHERE NOW() - 25 MINUTE > '$deleterow'");

Link to comment
https://forums.phpfreaks.com/topic/150209-php-help/#findComment-788837
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.