|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-07-16 15:48 UTC] Xuefer at 21cn dot com
as described in manual, addslashes is for prepairing database queries but it don't fit for mysql4.x when charset is set to multibyte, e.g. GBK escape/unescaping multibyte string is process differently in mysql-client/mysqld (btw: i dunno why it need to do such way) when a binary data addslashes() by php sent to mysqlserver, myodbc_remove_escape mysql_escape_string need upgraded mysql library but addslashes is used to process GPC when magic_quote is on PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 16:00:01 2025 UTC |
i've tested with lastest build but sorry to tell u that, problem still there <?php $data = chr(160) . "'"; echo mysql_character_set_name(); $data = mysql_real_escape_string($data); mysql_query("SELECT '$data'"); // got error ?> win32 build and bundled libmysql still has no gbk support build-in gbk and other multibyte charset has to be built in (i don't bother why have to) get the same error MySQL - 1064 - You have an error in your SQL syntax near ''?\''' at line 1 and i have to put gbk.conf in shared/charset dir in order to `fake' a charset which has to be built-in, although it's not right, but it's my only way mysql_character_set_name() return gbk if didn't put gbk.conf, return latin1, and apache/logs/error.log complain about missing charset file