tags:

views:

25

answers:

4

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?

A: 

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')
Cetra
A: 

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

cletus
How to know which configuration file to edit in IIS?
http://www.iis-aid.com/articles/how_to_guides/where_php_ini_is_loaded_from
cletus
I've set `magic_quotes_gpc = Off` but still not working.
Was it on? Did you change it? Did you restart IIS after changing it?
cletus
I only restarted my specific site inside IIS.That's why it didn't work.Is it a bug of IIS?
A: 

Disable the magic_quotes_gpc setting in your php.ini

Emil Vikström
A: 

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);
    }
Sarfraz