Jump to content

delete the table row automatically


phpmady

Recommended Posts

Hi,

 

I want to delete the row in the table, based on the expiration of the date.

 

for example ::now i have

 

id name    date

1  xxxx    30.05.10

2  yyyy    31.05.10

 

 

what i want is, today 30.05.10 so i want to have only 1 row i.e

 

id name    date

2  yyyy    31.05.10

 

 

 

Thanks

 

 

Link to comment
https://forums.phpfreaks.com/topic/203358-delete-the-table-row-automatically/
Share on other sites

You'll need to set up a CronJob on your server to call a file on your server that will have a DELETE query

http://en.wikipedia.org/wiki/Cron

 

You can set the cronJob to go off at midnight every night to delete the days rows.... though i don't udnerstand why you would want to do this? unless the table is just getting huge, why not keep them and use WHERE clauses with your SELECT queries

You'll need to set up a CronJob on your server to call a file on your server that will have a DELETE query

http://en.wikipedia.org/wiki/Cron

 

You can set the cronJob to go off at midnight every night to delete the days rows.... though i don't udnerstand why you would want to do this? unless the table is just getting huge, why not keep them and use WHERE clauses with your SELECT queries

 

 

 

thanks for your suggestion, that means how to write the select query for that

 

am having my date in unix timestamp

 

thanks

 

 

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.