Oracle - PHP --Help!!!
Posted: Mon Mar 14, 2005 5:33 am
Please help me.
I like to save the blob data from PHP to Oracle db with oracle stored procedure
this is a my PHP code
the photos_img is my table blob field name.
this is a oracle stored procedure
After run i have the error
feyd | Please use
I like to save the blob data from PHP to Oracle db with oracle stored procedure
this is a my PHP code
Code: Select all
$stmt = "begin photo_ins($a_cnt,$card_flags,'$curr_volume[2]','$curr_volume[1]',EMPTY_BLOB(),$curr_volume[4],$curr_volume[5],1,sysdate,:out_flags) RETURNING [b]photos_img[/b] INTO :the_blob; end;";
$result=OCIParse($link,$stmt) or die ("");
$blob = OCINewDescriptor($link, OCI_D_LOB);
OCIBindByName($result, ":the_blob", &$blob, -1, OCI_B_BLOB);
OCIBindByName ( $result, ":out_flags", &$out_flags, 5);
OCIExecute($result, OCI_DEFAULT);
$blob->save($FileContents);
OCIFreeStatement($result);this is a oracle stored procedure
Code: Select all
CREATE OR REPLACE PROCEDURE "e;PHOTO_INS"e;
(nphotos_id in integer, card_id in integer, nphotos_type in varchar2,
nphotos_name in varchar2, nphotos_img in blob, nphotos_w in integer, nphotos_h in integer, nstatusid in integer, nmoddate in date, flags out integer) is
begin
insert into photos values(nphotos_id, card_id, nphotos_type, nphotos_name, nphotos_img, nphotos_w, nphotos_h, nstatusid, nmoddate);
flags := 1;
commit;
EXCEPTION
WHEN OTHERS THEN
begin
flags := 0;
rollback;
end;
end;Code: Select all
Warning: ociexecute() їfunction.ociexecute]: OCIStmtExecute: ORA-06550: line 1, column 99: PLS-00103: Encountered the symbol "e;RETURNING"e; when expecting one of the following: := . ( % ; ORA-06550: line 1, column 138: PLS-00103: Encountered the symbol "e;END"e; in untitle.php
Warning: OCI-Lob::save() їfunction.save]: OCILobWrite: OCI_INVALID_HANDLE in untitle.phpfeyd | Please use
Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]