Skip to Content.
Sympa Menu

freetds - Re: Adding Strings with quote's in?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Bob Kline <bkline AT rksystems.com>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: Adding Strings with quote's in?
  • Date: Fri, 11 Feb 2000 14:56:05 -0500 (EST)


On Fri, 11 Feb 2000, Karl Pielorz wrote:

> Hi All,
>
> OK - We've now got PHP + FreeTDS + SQL V7 to talk quite nicely to each
> other... The problem I'm stuck with now is how to insert the following text
> into a database field...
>
>
> The Wolve's are coming
>
>
> Obviously, an
>
> INSERT INTO test VALUES( 'The Wolve's are coming' );
>
> Isn't going to cut it, so I used PHP's "AddSlashes" function, which does the
> equivalent of:
>
> INSERT INTO test VALUES( 'The Wolve\'s are coming' );
>
> Which it doesn't seem to like either...
>
> Any suggestions? - Is there a problem doing this with FreeTDS? (We have
> another system running MySQL which I do manage to use AddSlashes to protect
> embedded quotes etc. in field data with)...

Have you tried the solution supported by Standard SQL?

INSERT INTO test VALUES('The Wolve''s are coming')

--
Bob Kline
mailto:bkline AT rksystems.com
http://www.rksystems.com





Archive powered by MHonArc 2.6.24.

Top of Page