Hi John, Did you set the type n the database to dateTime?
Paul On Aug 15, 2009, at 10:30 PM, John Barrett wrote: > > I have a form, and I want to write a date entered in a DB field. > This is just being tested right now on the localhost. it seems to > only get 8 characters in the URL field. > > I tested it with test=adobe, URL = http://adobe.com, desc= adobe is > a company. > it gives me an error for MySQL and shows only http://a > > I am doing something really wrong here? I have used > the",<cfqueryparam cfsqltype="cf_sql_timestamp" value="#Now()#">" > before and it worked, but today I can't see to get this working. > > Any help would be fantastic. > > All I can think of is, that I am not using cfqueryparam for > everything, but this would not cause a MySQL error. Or that URL has > issues with he DB, but here I am just writing text. > > My Source > I have a db table test (ID, text, URL, desc, date) > I am trying to write a form to the DB, but add a date when the form > was submitted. > > my form is simple: > <cfform action="testing_action.cfm" method="post"> > <table width="630" border="0"> > <tr> > <td width="116">Text </td> > <td width="558"> <cfinput type="Text" name="text" > id="text" size="50"></td> > </tr> > <tr> > <td>URL</td> > <td> <cfinput type="Text" name="URL" id="URL" > size="50"></td> > </tr> > <tr> > <td>Discription </td> > <td><cftextarea name="desc" label="desc" > id="desc" rows="5" cols="40"></cftextarea></td> > </tr> > <tr> > <td> </td> > <td><cfinput type = "submit" name="submit" > class="button" value = "submit"></td> > </tr> > <tr> > <td> </td> > </tr> > </table> > </cfform> > > The action page: > <!--- Insert link into the database ---> > <cfquery datasource="#REQUEST.dataSource#"> > INSERT INTO test(text, URL,desc,date) > VALUES('#FORM.text#', '#FORM.URL#', > '#FORM.desc#',<cfqueryparam cfsqltype="cf_sql_timestamp" > value="#Now()#">) > </cfquery> > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4705 Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
