I am completely lost here.
There is a field of type "datetime" in the MySQL database. I want to populate its datetime with ColdFusion. I found that CreateODBCDateTime must be used to convert to maint format so that MySQL accepts it, so ...
<cfset myDateTime = CreateODBCDateTime("07-04-2012 20:11:00")>
And somewhere later:
<cfquery name="qAddDate">
INSERT INTO some_table
(`date`)
VALUES
('#myDateTime#')
</cfquery>
However, I get this error when trying to send data to the database:
You have an error in the SQL syntax; check the manual that matches your version of MySQL server for the correct syntax to use next to '2012-07-04 20:11:00'} ')' on line 8
Line 8 is the date line:
INSERT INTO some_table
(`date`)
VALUES
('{ts '2012-07-04 20:11:00'}')
Can anyone help?
Thank.
source
share