I'm trying to pass the current date and time from a validation page into a mysql table. I've tried numerous methods, but keep getting the same issue. Here is the most recent attempt: <cfset cdate = CreateODBCDateTime (Now())> "CFQuery Tags insert into XTable (fname, lname, cdate) values('#fname#', '#lname#', '#cdate#') "Close CFQuery The mysql db column is set up as follows: Field=cdate Type=DATETIME Null=not null Default2= 0000-00-00 00:00:00 Any thoughts?
Have you tried inserting #Now()# with no quotes, no createodbcdatetime...? insert into XTable (fname, lname, cdate) values('#fname#', '#lname#', #Now()#)
Or create the default value for your date field as CUR_DATE() then insert into XTable (fname, lname, cdate) values('#fname#', '#lname#', DEFAULT) ??