@imran7706authorSep 23.2006 — #What is the result (date format e.g. yyyy-mm-dd) you want to store in MYSql?
And why not use MySql functions to accomplish that?
Ronald ?[/QUOTE] I am not concerned about the result format the thing is I am getting the wrong date when I try to retrive date here is the full code hope this helps u understand my situation any help or suggestion is appreciated please [code=php]$A = getdate(); $Today = mktime(0,0,0,$A['mon'], $A['mday'], $A['year']); $SQL="insert into tourbookings values('', '".$_REQUEST[tourcode]."', '".$_REQUEST[email]."', '".$_REQUEST[phone]."', '".$_REQUEST[adults]."', '".$_REQUEST[childasadult]."', '".$_REQUEST[children]."', '".$_REQUEST[room]."', '".$_REQUEST[singlesuplement]."', '".$_REQUEST[insurance]."', '".$_REQUEST[airporttaxadult]."', '".$_REQUEST[airporttaxchild]."', '".$_REQUEST[departureairport]."', '".$_REQUEST[disc_adults]."', '".$_REQUEST[disc_childasadult]."', '".$_REQUEST[disc_children]."', '".$_REQUEST[grand_tot]."', '".$Today."', 0)";[/code]
@imran7706authorSep 23.2006 — #[code=php] $Today = date('Y-m-d H:i:s', mktime(0,0,0,$A['mon'], $A['mday'], $A['year'])); [/code][/QUOTE] when I insert this code I get this date Wed Dec 12, 1969
@NogDogSep 23.2006 — #I just realized that you were using getdate() to populate $A (I was thinking they were form values or such). Instead of all that, just do: [code=php] $Today = date('Y-m-d H:i:s'); [/code] Or simpler yet, just let MySQL do the work by using its NOW() function: [code=php] $SQL="insert into tourbookings values('', '".$_REQUEST[tourcode]."', '".$_REQUEST[email]."', '".$_REQUEST[phone]."', '".$_REQUEST[adults]."', '".$_REQUEST[childasadult]."', '".$_REQUEST[children]."', '".$_REQUEST[room]."', '".$_REQUEST[singlesuplement]."', '".$_REQUEST[insurance]."', '".$_REQUEST[airporttaxadult]."', '".$_REQUEST[airporttaxchild]."', '".$_REQUEST[departureairport]."', '".$_REQUEST[disc_adults]."', '".$_REQUEST[disc_childasadult]."', '".$_REQUEST[disc_children]."', '".$_REQUEST[grand_tot]."', NOW(), 0)"; [/code]
@NogDogSep 23.2006 — #In both cases I am getting Wed Dec 12, 1969 this date
Thanks for the concern[/QUOTE] Are you sure you have all the values in your query in the right sequence? (It's safer to explicitly list the field names and then give the corresponding values list in your query, rather than trusting that the database has the table's fields in the order you think they are.)
On the off chance that there's something wrong with your system clock, you could try a quick test with something like: [code=php] echo "date('Y-m-d H:i:s'); [/code]