Re: MSSQL using Sybase FreeTDS
| From: | Michael Sims | Date: | Thu, 03 Apr 2003 13:28:42 +0000 |
| Subject: | Re: MSSQL using Sybase FreeTDS | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-142124@lists.php.net to get a copy of this message | ||
On Thu, 3 Apr 2003 12:17:50 +0100, you wrote:
>Has anyone experienced this, and if so know of a possible solution?? I have
>used addslashes() etc but still no joy.
In addition to what the other respondents have said, you can set the
INI setting magic_quotes_sybase to 1, and this will change
addslashes() so that it escapes a single quote with a single quote
pair. This is a global setting, though. If you access two different
databases, say both MS-SQL and MySql, on the same page then I would
suggest that you not use the built in addslashes(), but instead roll
your own escaping function for each DB type. Or better yet, use a
database abstraction tool like Pear DB which includes a quote() method
that is specific to each DB backend.