I have a script , running under ColdFusion 6,1,0,63958. and
MySQL as Database Engine
<cfprocessingDirective pageencoding="utf-8">
<cfset setEncoding("form","utf-8")>
<cfcontent type="text/html; charset=UTF-8">
<CFIF IsDefined("code")>
<cfquery datasource="db" name="InsSQL">
Insert into test_unicode SET mem='#code#'
</cfquery>
<cfquery datasource="db" name="SelSQL">
SELECT * FROM test_unicode
</cfquery>
<CFOUTPUT query="SelSQL">
#ID#, #mem#<br>
</CFOUTPUT>
</CFIF>
<FORM name=ddd action="" method=post>
<textarea name=code rows=10 cols=20></textarea>
<input type=submit>
</FORM>
But when i try to submit Japan characters it returns :
Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC Socket][MySQL][ODBC
3.51 Driver][mysqld-4.0.26-standard]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 ''' at line 2
The error occurred in C:\...\unicode\index.cfm: line 10
8 : <cfquery datasource="db" name="InsSQL">
9 : Insert into test_unicode
10 : SET mem='#code#'
11 : </cfquery>
12 :
--------------------------------------------------------------------------------
SQL Insert into test_unicode SET mem='的最
臨的最'
DATASOURCE db
VENDORERRORCODE 1064
SQLSTATE 42000
Please try the following:
Check the ColdFusion documentation to verify that you are
using the correct syntax.
Search the Knowledge Base to find a solution to your problem.
HELP ME PLEASE , WHY ??? HOW find a solution ?