int ora_bind
(int cursor, string PHP variable name, string SQL parameter name, int length, int [type]);バインドに成功した場合に true を、そうでなければ、falseを返します。 エラーについての詳細は、ora_errorおよび ora_errorcode関数を用いて調べられます。
この関数は PHP variable name とSQL parameter nameをバインドします。 SQLパラメータは":name"の形になっていなければなりません。 オプションのtypeパラメータを用いて、SQLパラメータが、入出力 (0でデフォルト)か入力(1)か出力(2)パラメータかを定義できます。 PHP 3.0.1 では、数字の代わりに、定数ORA_BIND_INOUT、 ORA_BIND_INそしてORA_BIND_OUTを使うことができます。
ora_bind は ora_parseの後で ora_execの前に呼び出されなくてはなりません。 入力値は、可能であれば出力値を含むバインドしたPHP 変数で、 ora_execを呼び出した後、バインドしたPHP変数に 割り付けることによって与えることができます。
<?php ora_parse($curs, "declare tmp INTEGER; begin tmp := :in; :out := tmp; :x := 7.77; end;"); ora_bind($curs, "result", ":x", $len, 2); ora_bind($curs, "input", ":in", 5, 1); ora_bind($curs, "output", ":out", 5, 2); $input = 765; ora_exec($curs); echo "Result: $result<BR>Out: $output<BR>In: $input"; ?>