Import 503-9256962-4382268 Failure-1
You have a error in your SQL syntax; Check the manual that corresponds to your MySQL server version for the right syntax to use near ' 054-246-0787 ', ' JPS0001 ', ' 0243-BK ', ' iphone 4 with arm? (black) ', ' 1 ', '??? ' at line 1
I have done transcoding also reported above error, my transcoding function:
$recipient _name=mb_convert_encoding (Addslashes ($u [+]), ' UTF-8 ', ' Utf-8,sjis-win,eucjp-win ');
Echo Base64_encode ($u [16]) Result: MGIRG4XC
I output transcoding after the result is right: "?? GUI ", but do not know to write to the database will be error, I found that only contains" GUI "will write to the database failed.
Is there any way to solve this problem??
Reply to discussion (solution)
database field encoding is not supported
Gu gui \
?? Kyu
I re-output, the name with the "\", is not this reason?? How can i solve it?
$s = base64_decode (' mgirg4xc '); Echo ' character set ', mb_detect_encoding ($s, ' utf-8,sjis-win,eucjp-win '), '
'; Echo ' 16 Inside code ', Bin2Hex ($s), '
' Echo ' utf-8 ', $t = mb_convert_encoding ($s, ' utf-8 ', ' Utf-8,sjis-win,eucjp-win '), '
'; Echo ' 16 Inside code ', Bin2Hex ($t);
Character Set Jis-win
16 binary inside Code 986891838c 5c This 5c is \ 's 16 in-system code
Utf-8?? Kyu
16 Binary inside Code E9B7B2E5B7A3E59CAD
So you need
$recipient _name=mb_convert_encoding ($u [+], ' UTF-8 ', ' Utf-8,sjis-win,eucjp-win ');
Instead of
$recipient _name=mb_convert_encoding (Addslashes ($u [+]), ' UTF-8 ', ' Utf-8,sjis-win,eucjp-win ');
That can't be escaped with addslashes.
Escape ' requires Str_replace ("'", "\ '", $s)
Xuzuning greatly:
Do not escape, but there is a question to ask, because I inserted the content is a lot of countries, if not escaped, do not know which country's name contains some special, do not escape the words may be the same as write failure, excuse me, is there a way to solve this situation?
Transcode first, then escape