news:oP******************************@posted.inter netamerica...
[cross-posted to comp.lang.php for assistance]
No, it is a federally mandated time interval, and we need to know theI'd like to set the default for a date column "reserve_due" to be another
date field "reserve_serviced" plus 180 days, so that when the
"reserve_serviced" field is changed, the "reserve_due" is also updated
according to the date+180 formula:
It's generally a bad idea to put redundant information into a table.
Is there any situation, default or non-default, where reserve_due is
NOT reserve_serviced plus 180 days?
reserve_due = reserve_serviced + 180 days at any time when examing the table
with any arbitrary 3rd-party tools. While it might be considered redundant,
it is the main reason why reserve_serviced exists, and reserve_serviced can
change at any time before the 180-day limit.
Someone might be using Toad, MS-Access (?), a database export or some other
tool to examine the table, primarily to see the reserve_due date field for
each of the hundreds of pieces of equipment in the table or to change the
reserve_serviced date field when they have serviced a particular piece of
equipment.
I'd suggest dropping the reserve_due field entirely, and when yougear_inventory;
get data from the table, do something like:
select *, adddate(reserve_serviced, 180) as reserve_due from
if you just want to have MySQL do the date math.Yes, thank you, we could customize a query like that and attach it to a
structure generated by phpmyedit-generated scripts, but how would we state
that in the php script which is currently recalling the reserve_due field
(which will be deleted per your advice if we can get this to work), the
relevant portion of which follows? We'd like to have the mysql-calculated
reserve_due value appear at the same place in the output:
....
$opts['fdd']['reserve_serviced'] = array(
'name' ='Reserve serviced',
'select' ='T',
'maxlen' =10,
'sort' =true
);
$opts['fdd']['reserve_due'] = array(
'name' ='Reserve due',
'select' ='T',
'maxlen' =10,
'sort' =true
);
....