Skip to main content
Participant
July 18, 2008
Question

insert chinese big5 characters into database

  • July 18, 2008
  • 1 reply
  • 358 views
database: mysql
default charset of web page: utf-8 (specified in apache, all pages are in utf-8)
if I enter english, database insert is ok but if I enter chinese, error = "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 1"

display inputted fields are OK.

*** form.cfm ***
<form action="insert.cfm" method="post">
name: <input type="text" name="name" value=""><BR>
Password: <input type="text" name="password" value=""><BR>
<input type="submit" name="login_user" value="insert"><BR>
</form>

*** insert.cfm ***
<cfoutput>
#Form.name#<Br>
#form.password#<br>
</cfoutput>
<cfquery name="insert" datasource="test">
insert into test (name,password) values ('#Form.name#', '#Form.password#')
</cfquery>
    This topic has been closed for replies.

    1 reply

    Inspiring
    July 21, 2008
    dynason wrote:
    > database: mysql
    > default charset of web page: utf-8 (specified in apache, all pages are in
    > utf-8)

    what version of cf5? what version of mysql? has to be at least 4.1. is the db,
    etc. setup to handle that encoding? do you really want to use BIG5 instead of
    unicode? what db driver? it can't be ODBC.