Home > Archive > PHP DB > March 2004 > Date Manipulation
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Shannon Doyle 2004-03-26, 11:12 pm |
| Hi People,
Need some assistance in the following scenario:-
Inserting a date into the database that is entered into a form by the site
visitor. - This is easy enough.
However I now need to use the same date that has been entered by the site
visitor add 35 days and then insert into another table.
My question, how do I get the date entered into the form add 35days to it
and then include that into the same sql query as the first one. Or do I have
to use a second sql query? If the second query how would I get the date and
add 35days??
Cheers,
Shannon
| |
| Jimmy Brock 2004-03-26, 11:12 pm |
| $days = 35;
$day = $day + $days;
//calculate the new date
$calcDate = date($output, mktime (0,0,0,$month,$day,$year));
No need for a 2nd query...jus' insert the variable $calcDate into a column
in your table
Hope this helps,
Jimmy Brock
"Shannon Doyle" <shannon@wyattgroup.com.au> wrote in message
news:200403211314.i2LDE83B030712@mail.healthon-net.com...
> Hi People,
>
> Need some assistance in the following scenario:-
>
> Inserting a date into the database that is entered into a form by the site
> visitor. - This is easy enough.
>
> However I now need to use the same date that has been entered by the site
> visitor add 35 days and then insert into another table.
>
> My question, how do I get the date entered into the form add 35days to it
> and then include that into the same sql query as the first one. Or do I
have
> to use a second sql query? If the second query how would I get the date
and
> add 35days??
>
>
> Cheers,
>
> Shannon
|
|
|
|
|