Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: put clob into oracle db from php
On 19 Nov 2002 03:04:03 -0800, kummer_at_w3concepts.ch (alex) wrote:
>i have following problem: i try to insert character data into a clob
>column in a oracle database. the character data contains line feeds,
>carriage returns and other characters which normally have a function
>in query strings.
>
>i tried to insert the data using a normal query string. however, i
>always got the message, that the data contains illegal characters. is
>there a way i can put my 'illegal characters' into the db anyway?
Sounds like you're embedding the value into the query itself. Do NOT do this, ever; use bind variables.
>i forgot to mention that i use php4 and odbc to access the db. and so
>far i did not find a possiblity to convert the string to unicode.
There is an example on inserting CLOBs on the front page of the OCI8 section of the PHP manual.
http://www.php.net/manual/en/ref.oci8.php
Scroll down to Example 1.
And one for BLOBs in the OCINewDescriptor section:
http://www.php.net/manual/en/function.ocinewdescriptor.php
-- Andy Hassall (andy@andyh.org) icq(5747695) http://www.andyh.org http://www.andyhsoftware.co.uk/space | disk usage analysis toolReceived on Tue Nov 19 2002 - 05:26:08 CST