RE: [PHP] Adding a variable to oracle that contains quotation mar ks??
| From: | Rea_David at emc dot com | Date: | Tue, 21 Jan 2003 15:05:22 +0000 |
| Subject: | RE: [PHP] Adding a variable to oracle that contains quotation mar ks?? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-132420@lists.php.net to get a copy of this message | ||
Thanks Rick & Henry, but I am still unable to add single quotation marks '.
When I added the \' to the variable as given below (thanks again Rick) I get
the following error when trying to add anything, regardless of ':
Warning: Ora_Parse failed (ORA-00911: invalid character -- while processing
OCI function OPARSE) in
/services/apache_1.3.22/www-dev/isg/isg_tools/activitytracker/admin/selectac
tivity.php on line 28
Perhaps I'm missing something very small? I have done a stripslash on the
variable also, but with no extra success!
Any ideas?
Dave
P.S. Henry, the double quotation is ok.
-----Original Message-----
From: Henry [mailto:henry@cafelab.com]
Sent: 21 January 2003 13:12
To: Rick Emery; Rea_David@emc.com; php-general@lists.php.net
Subject: Re: [PHP] Adding a variable to oracle that contains quotation
marks??
Once you use double quota mark the character BackSlash doesn't need anymore
that's my experience ^_^
----- Original Message -----
From: "Rick Emery" <remery@emeryloftus.com>
To: <Rea_David@emc.com>; <php-general@lists.php.net>
Sent: Tuesday, January 21, 2003 8:56 PM
Subject: Re: [PHP] Adding a variable to oracle that contains quotation
marks??
> $query = "UPDATE ACTIVITY SET COMMENTS = \'$updatecomments\' WHERE
ACTIVITY_ID =\'$actcode\'";
>
> ----- Original Message -----
> From: <Rea_David@emc.com>
> To: <php-general@lists.php.net>
> Sent: Tuesday, January 21, 2003 6:53 AM
> Subject: [PHP] Adding a variable to oracle that contains quotation marks??
>
>
> Hi All,
>
> I'm trying to add a variable to an oracle database but it fails due
> to the fact that it contains quotation marks. These have to be present
for
> the end user. My Script is as follows:
> ===========================================================
> if ($conn == true)
> {
>
> $query = "UPDATE ACTIVITY
> SET COMMENTS = '$updatecomments' WHERE ACTIVITY_ID =
> '$actcode'";
> $cursor = Ora_Open ($conn);
> $result = Ora_Parse ($cursor, $query);
> $result = Ora_Exec ($cursor);
>
> ora_close($cursor);
> Ora_Logoff($conn);
> }
> ===========================================================
>
> Can anyone tell me what to do!
>
> Thank you
> Dave
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php