Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在不使用php oracle循环的情况下仅获取1行_Php_Oracle_Oracle Call Interface - Fatal编程技术网

如何在不使用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];
}