Re: MSSQL using Sybase FreeTDS
| From: | Lowell Allen | Date: | Thu, 03 Apr 2003 12:19:08 +0000 |
| Subject: | Re: MSSQL using Sybase FreeTDS | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-142115@lists.php.net to get a copy of this message | ||
> From: "Craig" <craig@deconstructor.net>
>
> Im running PHP 4.31 on RH Advanced Server 2.1
>
> I am connecting, to M$SQL Server 2000 using FreeTDS -- with Sybase support,
> and Im stumped on 1 thing:
>
[snip]
>
> The above code works fine, except when one of the fields e.g client_name -
> Has a quoted string or an apostrophe in it, it just spews the following
> error:
>
> Warning: Sybase error: Line 1: Incorrect syntax near 's'. (severity 15) in
> /var/www/html/clients/pages/add_client.php on line 17
>
> Has anyone experienced this, and if so know of a possible solution?? I have
> used addslashes() etc but still no joy.
MSSQL doesn't use slashes for escaping. You probably need to use a single
quote character instead of a slash. See user notes in the PHP manual,
<http://www.php.net/manual/en/function.addslashes.php>,
which will direct
you to other info on changing the escape character used.
--
Lowell Allen