I have a form that has a field for entering a birth date.
This is inserted into a MySQL date field defined as 'DATE'. The format MySQL Date fields require is YY-MM-DD. Not really user friendly. (Isn't this a very common issue?)
Is there a way to allow users to enter "any" date format into the form, then convert it for inserting into the database? I'm sure that is...I just don't get how it would work.
The form field is named 'birthdate'; the mySQL field name is 'birthdate' (funny how that worked out).
So...the form field is written like this:
<input type=text name=birthdate size="23" value="<?=$a1[birthdate]?>">
The query is written like this:
$q1 = "insert into members set birthdate = '$_POST[birthdate]'"; $r1 = mysql_query($q1) or die(mysql_error());
I'm pretty sure I need to use strtotime....but how? Where?
Thanks for any insight!
(BTW, my birthday is this Monday, April 10...it would be a good birthday indeed if I could get this working!)