Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Remoting / December 2003



Tip: Looking for answers? Try searching our database.

insert date to database thru cfc

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
illusime - 19 Dec 2003 07:39 GMT
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/
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.