3 Replies Latest reply on May 23, 2006 3:28 AM by ProgmanMX

    japan text, ColdFusion and MySQL

    ProgmanMX Level 1
      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 ?
        • 1. Re: japan text, ColdFusion and MySQL
          Level 7
          ProgmanMX wrote:

          > 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

          well first off don't use ODBC, use the JDBC driver (probably should get the
          latest from mysql & config it as "other" in the dsn section of cfadmin). second,
          *is* the version of mysql that you're running unicode capable? third, did you
          set the database encoding to unicode/utf-8?
          • 2. Re: japan text, ColdFusion and MySQL
            ProgmanMX Level 1
            Yes, it seems MySQL unicode capable ... cause i will try to implement same script by PHP (on the same table, same DB), and it performs great !

            Maybe ane other advice ? Maybe i can in someway ron PhP script from CF to perform this mechanism ? ANY solution required !
            thanks in advance !
            • 3. Re: japan text, ColdFusion and MySQL
              ProgmanMX Level 1
              But i have only control panel with only ODBC access ...

              please , if i will ask hosting provider, how i can explain him about prooer JDBC settings ?

              Thanks in advance !