Wanted to insert the current date to the database throught the component, but its not working.. Anyone knows how to solve this prob?
<cffunction name="saveData" access="remote" returnType="boolean">
<cfargument name="postName" type="string" required="true" >
<cfargument name="content" type="string" required="true" >
<!---cfargument name="date" type="date" required="true" --->
<cfset myDate = CreateODBCDate(now())>
<cfquery datasource="portfolio" >
INSERT INTO shoutboxTable(postName, content,date)
VALUES ('#postName#','#content#',#myDate#)
</cfquery>
<cfreturn 1>
</cffunction>
Tom Muck - 19 Dec 2003 17:51 GMT
> Wanted to insert the current date to the database throught the component, but its not working.. Anyone knows how to solve this prob?
I've found that this method works pretty well across database drivers:
<cfset myDate =
"#DateFormat(now(),'mm/dd/yyyy')# #TimeFormat(Now(),'HH:mm:ss tt'#">
<cfquery datasource="portfolio" >
INSERT INTO shoutboxTable(postName, content,date)
VALUES ('#postName#','#content#','#myDate#')
</cfquery>
--
---------------------------------------------------------------
Tom Muck
author -- Flash Remoting: The Definitive Guide
http://www.flash-remoting.com/notablog
Team Macromedia Volunteer for Flash
Extending Knowledge, Daily
http://www.communityMX.com/