Fix OCINewDescriptor() example

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@46780 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Sterling Hughes 2001-05-07 01:35:01 +00:00
parent 1fd5d4ba40
commit 151be34589

View file

@ -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";