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...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to