Re: Addslashes not working correctly?

From: Date: Sat, 19 Jan 2002 00:49:56 +0000
Subject: Re: Addslashes not working correctly?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-81179@lists.php.net to get a copy of this message
At 10:43 AM 1/18/2002 -0600, Gonzalez, Zara E wrote:
Now I am using MSSQL via freetds and since the commands for MSSQL and Sybase are basically identical as far as php is concerned, I am assuming that I have to use the "sybase method" to escape quotes. However, I can't seem to figure out how to do this, can somebody point me in the right direction?
Place ini_alter("magic_quotes_sybase",1); at the top of your scripts... You can also set this in your php.ini if this is a sitewide change you wish to make. Alternatively you can set this via an .htaccess file if you're using Apache and you only want to apply this setting on a per-directory basis. I personally wrap all database functions inside an DB object that connects to the database when I instantiate it. Inside the DB object's constructor, along with the line that establishes the connection, I will place the above line. I have two objects...one for MySQL connections and one for MS-SQL connections...since the ini_alter line is in both of the objects (turned on for one and off for the other) I don't have to concern myself with which style of magic quotes I'm using...I just instantiate the correct DB object and it takes care of that little detail for me. I'd be glad to explain and even illustrate the classes I use if you'd like. It's made my life in a mixed development environment (MySQL/MS-SQL) a WHOLE lot easier...

« previous php.general (#81179) next »