Page 1 of 1
Combining separate date input elements into one date
Posted: Wed Oct 07, 2009 9:20 pm
by edawson003

- dob.gif (923 Bytes) Viewed 131 times
I would like to take user input in the above date field format and combine the date elements and post it to my mysql table. How can I set that up?
Re: Combining separate date input elements into one date
Posted: Wed Oct 07, 2009 9:41 pm
by requinix
date = YYYY + "-" + MM + "-" + DD
How much thought have you put into this?
Re: Combining separate date input elements into one date
Posted: Wed Oct 07, 2009 11:39 pm
by edawson003
thanx for the info tasairis; however, if you think certain posts are too elimentary and not worth your time, I suggest next time don't bother responding.
This is more like what I was looking to get as a response
Code: Select all
<? $todo=$_POST['todo'];
if(isset($todo) and $todo=="submit"){
$month=$_POST['month'];
$dt=$_POST['dt'];
$year=$_POST['year'];
$date_value="$month/$dt/$year";
echo "mm/dd/yyyy format :$date_value<br>";
$date_value="$year-$month-$dt";
echo "YYYY-mm-dd format :$date_value<br>";
}
?>
More useful and less snarq!
Re: Combining separate date input elements into one date
Posted: Thu Oct 08, 2009 12:59 am
by requinix
1. We don't like giving solutions. We give hints and clues and suggestions.
2. You didn't provide enough information for such a detailed answer as you wanted. How did I know what the fields were called? How did I know that the month field was going to give a zero-padded two digit number and not a month name? How did I know about this "todo" stuff?
3. It's spelled "snark".
Re: Combining separate date input elements into one date
Posted: Thu Oct 08, 2009 1:06 am
by edawson003
By the way, who's "we"? The Federation forum contributors? Of which, I'm guessing your the president...
And while your at it, correcting mispellings and such, you should go ahead and check your grammar.
Code: Select all
We give hints [color=#FF0000]and[/color] clues [color=#FF0000]and[/color] suggestions.
Correct:We give hints
, clues and suggestions.
Thanks for playing!
P.S.
Check out:
Eats, Shoots & Leaves: The Zero Tolerance Approach to Punctuation
by Lynne Truss
We of the the Snar
qqq Society give this book two thumbs up.