Re: Problems inserting single quote into Oracle database
| From: | Kevin Dewsnup | Date: | Thu, 01 Nov 2001 00:45:28 +0000 |
| Subject: | Re: Problems inserting single quote into Oracle database | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-73100@lists.php.net to get a copy of this message | ||
Thanks David,
I set magic_quotes_sybase to "On" (even though I'm using oracle) and that
did the trick.
php.ini
; Use Sybase-style magic quotes (escape ' with '' instead of \').
magic_quotes_sybase = On
I was able to insert data with an apostrophie into the database from a form
and the data looks good. Seems like Sybase and Oracle treat single quotes
in a similar way.
I wonder why there is no magic_quotes_oracle?
-Kevin
----- Original Message -----
From: "David Robley" <huntsman@www.nisu.flinders.edu.au>
To: "Kevin Dewsnup" <kdewsnu@yahoo.com>; <php-general@lists.php.net>
Sent: Tuesday, October 30, 2001 5:57 PM
Subject: Re: [PHP] Problems inserting single quote into Oracle database
> On Wed, 31 Oct 2001 11:01, Kevin Dewsnup wrote:
> > I am having problems with inserting single quote's
> > into an oracle 8.1.7 database through a form.
> >
> > When inserting 'its' it works fine.
> >
> > When inserting 'it's' I get this error:
> > "OCIParse: ORA-01756: quoted string not properly
> > terminated in blah..."
> >
> > So then I try 'it''s' (which works in SQL*Plus) I get
> > this error:
> > "OCIStmtExecute: ORA-00911: invalid character in
> > blah..."
> >
> > Thank's in advance!
> >
> > -Kevin
>
> Backslash works for mysql. Have a look at the addslashes (for putting
> into Oracle) and stripslashes (for displaying data retrieved) functions,
> also the magic_quotes settings in your php.ini.
>
> --
> David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
> CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
>
> My lucky color just faded.
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com