mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
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:
parent
1fd5d4ba40
commit
151be34589
1 changed files with 8 additions and 2 deletions
|
@ -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";
|
||||
|
|
Loading…
Reference in a new issue