hi Paul,
I just set the database setting to dateTime, and when I run the  
example I get this error. Now I don't any issues do you?
You have an error in your SQL syntax; check the manual that  
corresponds to your MySQL server version for the right syntax to use  
near 'desc,date) VALUES('John','http://john.com','John','2009-08-15 '  
at line 1

The error occurred in /Users/johnbarrett/Sites/FoodSystems/ 
testing_action.cfm: line 4
2 :                 <cfquery datasource="#REQUEST.dataSource#">
3 :                   INSERT INTO test(text,URL,desc,date)
4 :                    
VALUES('#FORM.text#','#FORM.URL#','#FORM.desc#',<cfqueryparam  
cfsqltype="cf_sql_timestamp" value="#Now()#">)
5 :                 </cfquery>
here is a screenshot of the DB:
http://hawaiiflash.net/DB.jpg

Does the fact that I can't set the size of the fields cause an error?
Thanks s much,
John
On Aug 15, 2009, at 4:48 PM, Paul Kukiel wrote:

>
> 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:4707
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to