可以将返回的id放入变量中。例如,此代码:
$data = array("larry","bill","steve");
$db = OCILogon("scott","tiger");
$stmt = OCIParse($db,"insert into names values (myid.nextval,:name) returning id into :id");
OCIBindByName($stmt,":ID",$id,32);
OCIBindByName($stmt,":NAME",$name,32);
while (list(,$name) = each($data))
{
OCIExecute($stmt);
echo "$name got id:$id\n";
}
这给了你身份证
$name
以变量的形式
$id
. 相应地更改SQL。