|
Posted by J.O. Aho on 01/26/06 14:21
Spiral wrote:
> Hello,
>
> I am trying to delete a record from my table when a php page is executed
> I have various fields that are entered into a form, the two im guessing
> which I need to use in my query are $date (automatically generated from
> server) and an $endate which the user enters.
>
> How do I go about deleting this record when the end date happens, I am
> going to use CRON to trigger the php page once a day.
You can use cron to execute a delete-php-script, or you can let the script
that inserts new data to make a check and delete those that has gone old, this
would require that there are daily inserts or that you add a WHILE argument
for your search queries to not include old ones.
DELETE FROM mytable WHERE datecolumn < CURDATE()
//Aho
Navigation:
[Reply to this message]
|