You are here: Re: delete record from DB on users selected end date « PHP SQL « IT news, forums, messages
Re: delete record from DB on users selected end date

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация