如何仅在不使用php oracle循环的情况下获取1行

时间:2018-07-31 06:50:52

标签: php oracle oci

$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];
}

此查询仅返回1个单行数据....我认为将循环用于显示数据不是很好,也许还有其他方法吗?

0 个答案:

没有答案