Topic awaiting preservation: PHP date into MySQL trouble (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: Sydney, Autralia |
posted 11-04-2004 11:01
hi, |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
posted 11-04-2004 14:14
first you turn your date into a timestamp via php->strtotime() |
Maniac (V) Mad Scientist From: :morF |
posted 11-07-2004 00:33
if you've got three seperate drop-downs for Day, month and year why not simply arrange them backwards? MySQL's date fields read YYYYMMDD I believe, so simply make sure the your date values for month and day have leading zeroes for all values under 10 and thne just concatonate them and insert. On my MySQL test server that works for me. |
Paranoid (IV) Inmate From: France |
posted 11-07-2004 00:37
To find the date format, why don't you simply insert a date using the now() function, and then retrieve it to see how the dates are actually formated in MySql ? Then you'll know how to format your dates in PHP before inserting them in a table. That's not hard. |
Maniac (V) Inmate From: under the bed |
posted 11-07-2004 04:30
I'd like to second skaarrj's suggestion. It's a very simple matter, since must be grabbing those values seperately to simply combine them in the proper order - $date = "$year-$month-$day" where $year $month and $day are the values captured from the form (mysql will actually accept it with or without the dashes....but I like the dashes....). |