Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : Oracle Functions [deprecated] : ora_numcols

ora_numcols

Returns the number of columns (PHP 4, PHP 5 <= 5.0.5)
int ora_numcols ( resource cursor )

Returns the number of columns in a result. It only returns meaningful values after a parse/exec/fetch sequence.

Parameters

cursor

An Oracle cursor, opened with ora_open().

Return Values

Returns the number of columns as an integer, or FALSE on error.

ChangeLog

Version Description
5.1.0

The oracle extension is deprecated in favor of oci8.

Notes

When using oci8 as a replacement for the deprecated oracle extension, consider using:

oci_num_fields()

Code Examples / Notes » ora_numcols

tim dot mcguire

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.........................
}


Change Language


Follow Navioo On Twitter
ora_bind
ora_close
ora_columnname
ora_columnsize
ora_columntype
ora_commit
ora_commitoff
ora_commiton
ora_do
ora_error
ora_errorcode
ora_exec
ora_fetch_into
ora_fetch
ora_getcolumn
ora_logoff
ora_logon
ora_numcols
ora_numrows
ora_open
ora_parse
ora_plogon
ora_rollback
eXTReMe Tracker