I'm sure this will be a quick and easy one for someone:
I have the date working in the format (y-m-d) and want to perform some calculations using the date -6 days. I need this to be done in the PHP script and not as part of a query. Does anyone know how I should go about doing this.
What I need it for is that I am passing today's date and the date from 6 days ago as part of an ORACLE query to retrieve data.
The $start_date would be the date 6 days ago and the $end_date is today. It works fine if I hardcode the dates in or input them using a form but I don't know how to set these particular dates when the page opens.
The query would be:
$cmdstr = "SELECT date1, $FIELD1, $FIELD2 FROM fnmp WHERE date1 BETWEEN TO_DATE('$start_date', 'YYYY-MM-DD') AND TO_DATE('$end_date', 'YYYY-MM-DD') ORDER BY date1 ASC";
Any help is greatly appreciated.
Thanx in advance!!