如何在不使用php oracle循环的情况下仅获取1行
此查询仅返回一行数据……我认为使用循环显示数据不好,可能还有其他方法?简单,不要使用循环,只需执行如何在不使用php oracle循环的情况下仅获取1行,php,oracle,oracle-call-interface,Php,Oracle,Oracle Call Interface,此查询仅返回一行数据……我认为使用循环显示数据不好,可能还有其他方法?简单,不要使用循环,只需执行$row=oci\u fetch\u row($stid)。您可能还想签出oci\u fetch\u all,显然您也可以通过类似oci\u fetch\u all($stid,$result)的方式获得它$result就是您要找的。所以行仍然需要arry,我的意思是,我需要像这样放置$def_usr=$row[0],$status=$row[1] $stid = oci_parse($conn,
$row=oci\u fetch\u row($stid)
。您可能还想签出oci\u fetch\u all
,显然您也可以通过类似oci\u fetch\u all($stid,$result)的方式获得它代码>$result
就是您要找的。所以行仍然需要arry,我的意思是,我需要像这样放置$def_usr=$row[0],$status=$row[1]
$stid = oci_parse($conn, ' SELECT def_usr,status,subject,type,site,def_date,VER_DATE,VER_USR,closed_date,problem,hd_no,solution,attachment FROM hdr_web where hd_no=:num2');
oci_bind_by_name($stid, ":num2",$no);
oci_execute($stid);
$count = 0;
while (($row = oci_fetch_row($stid)) != false)
{
$def_usr=$row[0];
$status=$row[1];
$subject=$row[2];
$type=$row[3];
$site=$row[4];
$def_date=$row[5];
$ver_date=$row[6];
$VER_USR=$row[7];
$closed_date=$row[8];
$problem=$row[9];
$hd_no=$row[10];
$solution=$row[11];
$file=$row[12];
}