?php / * OCIDefineByName example - thies@thieso.net (980219) * / $conn = OCILogon("scott" ,"tiger"); $stmt = OCIParse($conn ,"select empno, ename from emp"); / * the define MUST be done BEFORE ociexecute! * / OCIDefineByName($stmt ,"EMPNO",$empno); OCIDefineByName($stmt ,"ENAME",$ename); OCIExecute($stmt); while (OCIFetch($stmt)) {echo "empno :".$empno ."\n"; echo "ename :".$ename ."\n";} OCIFreeStatement($stmt); OCILogoff($conn);?
?php / * Exemple ociDefineByPos par thies@thieso.net (980219) * / $conn = ociLogon("scott" ,"tiger"); $stmt = ociparse($conn ,"select empno, ename from emp"); / * La définition DOIT être faîte AVANT ociexecute! * / ociDefineByName($stmt ,"EMPNO", $empno); ociDefineByName($stmt ,"ENAME", $ename); ociexecute($stmt); while (ociFetch($stmt)) {echo "empno :".$empno ."\n"; echo "ename :".$ename ."\n";} ociFreeStatement($stmt); ociLogoff($conn);?