This topic is locked

when date end change value of field to 0?

2/20/2009 8:35:07 AM
PHPRunner General questions
D
Darkwoods author

hello i have a table where there are end date field and start date field and status
so what i want to do is when the dates end i want the status to change from 1 to 0
the question is how do i do that on phprunner?
Thank you

J
Jane 2/20/2009

Hi,
you can run update query in the List page: Before process event on the Events tab.

In this case you will update table after refreshing page in browser.

Here is a just sample:

global $conn;

$strUpdate = "Update tablename set status=0 where EndDate<Now()";

db_exec($strUpdate,$conn);


Or you can write a separate script for this purpose. This script needs to be scheduled to run once a day, check dates and delete records if required. To schedule this script use CRON on Unix systems and Windows scheduler on Windows.