Hi,
Please, take a look at DreamWeaver code and use it!
It is:
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
This code make all working with or without get_magic_quotes_gpc
Use this code in all your update/insert query to database!!