In article <mr**********************@individual.net>,
mr@sandman.net
says...
In article <41**********************@dreader2.news.tiscali.nl >,
Roderik <ma**@roderik.net> wrote:
Is it possible to perform actions at certain moments. Like resetting a
database record every first day of month?
Of course, I do it all the time. Question is what kind of host you are running
PHP on. If it's linux/unix, you'd probably use 'cron'. If it's Windows you'll
probably built that built-in schedular whatever-its-name-is, if that can
execute shellscripts.
This is probably more suited to a forum for your particular database.
Web server and its plugins should not be involved in regular DB internal
maintenance.
Most DB have PROCEDURE operations, create one to do what you want and
having the OS run it through one of the above schedulers.
Some full-SQL databases also have TRIGGER command to run SQL
on/before/after certain DB actions.
ie:
in DB:
CREATE PROCEDURE monthly
BEGIN
UPDATE test SET ThisMonth=MONTH(NOW());
END
OS runs <every day, or month, or week, whatever>
mysql -u user -ppass -Dtest --exec="monthly()"
--
AJ
Treehouse Networks abuse@
www.treenetnz.com