开发者

PHP's database operation not working property in IIS?

开发者_开发技巧

After this statement:

insert into table... value(..,"It\'s my title")

In database I can see :

It\'s my title

It only happens when in IIS.How to fix?


My guess is you have magic quotes enabled on IIS. Turn it off. See Disabling Magic Quotes.


I think for that statement, because you are using double quotes you don't need to escape the single quote

You can try this instead:

insert into table... value(..,'It\'s my title')


Disable the magic_quotes_gpc setting in your php.ini


First of all disable magic quotes, it is deprecated anyway. You can use either of mysql_real_escape_string or addslashes functions.

    // disable magic_quotes_runtime
    if (get_magic_quotes_runtime())
    {
        @set_magic_quotes_runtime(0);
    }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜