note 1139 deleted from Oracle functions by ronabop
| From: | ronabop@php.net | Date: | Tue, 08 Aug 2000 19:53:07 +0000 |
| Subject: | note 1139 deleted from Oracle functions by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-684@lists.php.net to get a copy of this message | ||
Since ora_numrows always will return a 0,
The code above could be written as follows; By saying while ora_fetch do, the fetch will keep
grabbing eah consecutive row until false.
Doing a COUNT(*) is poor coding.
<?
putenv("ORACLE_SID=ORACLE");
putenv("ORACLE_HOME=/opt/oracle/oracle/8.0.3");
$conn = ora_logon("scott", "tiger");
$curs = ora_open($conn);
ora_commitoff($conn);
$query = sprintf("select * from cat");
ora_parse($curs, $query);
ora_exec($curs);
$ncols = ora_numcols($curs);
while (ora_fetch($curs))
{
for ($i=0; $i<$ncols; $i++)
{
printf("%s = %s", ora_columnname($curs,$i), ora_getcolumn($curs,$ i));
printf("<br>");
}
}
ora_close($curs);
ora_logoff($conn);
?>
Hope that helps
Wayne Hartley
Teaching and Learning Support Services
Queensland University of Technology
Brisbane, Queensland
Australia, 4000