ora_numcols

(PHP 3, PHP 4, PHP 5 <= 5.1.0RC1)

ora_numcols -- 返回列的数目

描述

int ora_numcols ( resource cursor )

函数 ora_numcols() 返回结果中列的数目。该函数只有在依次执行 parse/exec/fetch 后使用才返回有意义的值。

参见 ora_parse()ora_exec()ora_fetch(),和 ora_do()


add a note add a note User Contributed Notes
tim dot mcguire at dnr dot state dot mn dot us
22-Aug-2001 09:30
I would like to correct the above documentation.  I am able to get results from ora_numcols after a parse & exec sequence and before a fetch:
ora_parse($curs,$query);
ora_exec($curs);

$numfields = ora_numcols($curs);

for($col=0;$col<$numfields;$col++){
  echo ora_columnname($curs,$col);
}
while(ora_fetch($curs)){
etc.........................
}