delphi操作utf8型mysql时,sql出错的解决
将中文名称通过AnsiToUtf8转换为utf,生成如下sql:
update `dev_columns` set `column_cn_name` = "鐢ㄦ埛鍚?,`column_show` = 1 where `id` = 8
出现如下错误提示
SQL 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 '"鐢ㄦ埛鍚?,`column_show` = 1 where `id` = 8' at line 1
我的解决办法是,在中文值之后加上一个空格,然后用AnsiToUtf8转换。
update `dev_columns` set `column_cn_name` = "鐢ㄦ埛鍚?,`column_show` = 1 where `id` = 8
出现如下错误提示
SQL 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 '"鐢ㄦ埛鍚?,`column_show` = 1 where `id` = 8' at line 1
我的解决办法是,在中文值之后加上一个空格,然后用AnsiToUtf8转换。