From 151be3458983704dace9fa81a600d577de3910e2 Mon Sep 17 00:00:00 2001 From: Sterling Hughes Date: Mon, 7 May 2001 01:35:01 +0000 Subject: [PATCH] Fix OCINewDescriptor() example git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@46780 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/oci8.xml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/functions/oci8.xml b/functions/oci8.xml index 4593e35844..915ae0d8cb 100644 --- a/functions/oci8.xml +++ b/functions/oci8.xml @@ -260,7 +260,13 @@ OCILogoff($conn); records just after the insert. */ -$conn = OCILogon("scott","tiger"); +$conne { + // $lob_upload contains the temporary filename of the uploaded file + $conn = OCILogon($user, $password); + $lob = OCINewDescriptor($conn, OCI_D_LOB); + $stmt = OCIParse($conn,"insert into $table (id, the_blob) + values(my_seq.NEXTVAL, EMPTY_B += OCILogon("scott","tiger"); $stmt = OCIParse($conn,"insert into emp (empno, ename) ". "values (:empno,:ename) ". @@ -769,7 +775,7 @@ Upload file: <input type="file" name="lob_upload"><br> $stmt = OCIParse($conn,"insert into $table (id, the_blob) values(my_seq.NEXTVAL, EMPTY_BLOB()) returning the_blob into :the_blob"); OCIBindByName($stmt, ':the_blob', &$lob, -1, OCI_B_BLOB); - OCIExecute($stmt); + OCIExecute($stmt, OCI_DEFAULT); if($lob->savefile($lob_upload)){ OCICommit($conn); echo "Blob successfully uploaded\n";