im using cfmx 6.1, xp pro

ok when i do this
<!--- set form variables --->
<cfset title=trim(form.title)>
<cfset content=trim(form.content)>
<cfset insertDate=#CreateODBCDate(Now())#>

<!--- do insert now --->
<CFQUERY NAME="qnews" DATASOURCE="#dsn#" USERNAME="#un#" PASSWORD="#pw#">
    INSERT INTO guide (title, content, update)
             VALUES ('#title#', '#content#',  #insertDate#)
</CFQUERY>

i get this

Error Executing Database Query.
Syntax error or access violation: 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 'update) VALUES ('erwerew', 'rerrwrew w', '2004-

The error occurred in C:\CFusionMX\wwwroot\RMA_new\admin\news\process.cfm:
line 22

20 : <CFQUERY NAME="qnews" DATASOURCE="#dsn#" USERNAME="#un#"
PASSWORD="#pw#">
21 :     INSERT INTO guide (title, content, update)
22 :              VALUES ('#title#', '#content#',  #insertDate#)
23 : </CFQUERY>
24 :



>> right but thats the thing, i figured i could just use Now() and didnt
>> think twice about it, until i ran it & it choked. U'd think that would
>> be properly formated
>>
>> so when i use
>> <!--- do insert now --->
>> <CFQUERY NAME="qnews" DATASOURCE="#dsn#" USERNAME="#un#"
>> PASSWORD="#pw#">
>>     INSERT INTO guide (title, content, update)
>>              VALUES ('#title#', '#content#', #Now()#)
>> </CFQUERY>
>>
>> i get
>>
>> Error Executing Database Query.
>> Syntax error or access violation: 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 'update) VALUES ('dddddd',
>> 'dsfdfdfdsf f', '2004-0
>>
>
> Ermmm....  A bit further down in the error message you should be able to
>  see the complete SQL statement that was created/sent.
>
> Can you post that please?
>
> Also, what version of CF are you on?  4.5x?
>
> Regards
>
> Stephen
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to