Jump to content

php help


flemingmike

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.