note 4422 deleted from ref.oracle by sniper
| From: | sniper@php.net | Date: | Mon, 11 Aug 2003 05:07:28 +0000 |
| Subject: | note 4422 deleted from ref.oracle by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-53843@lists.php.net to get a copy of this message | ||
Note Submitter: kfutivic@delfin.hr
----
So everybody posts some select * ...
code so this works on WIN95 + HTTPD nice... getting data and
**** fixing nrows BUG
!Please developers fix it :)
ORA 73 works and 80 doesn't...
(dunno why) so here it is:
************************************
<PRE>
<?php echo "Hi, I'm a PHP script trying to logon on OR73";
$conn = Ora_Logon("login@TNS", "password");
$curs = ora_open($conn);
$table="TABS";
$query = sprintf("select * from $table");
$curs1 = ora_open($conn);
$query1 = sprintf("select count(*) from $table");
echo "...OK 1<br>";
ora_parse($curs, $query);
ora_exec($curs);
ora_fetch($curs);
ora_parse($curs1, $query1);
ora_exec($curs1);
ora_fetch($curs1);
$ncols1 = ora_numcols($curs1);
$nrows1 = ora_numrows($curs1);
$real_rows=ora_getcolumn($curs1, 0);
$ncols = ora_numcols($curs);
$nrows = ora_numrows($curs);
printf("Result size is $ncols cols by <strong>$real_rows</strong>
rows.<br><br><gt>");
for ($i=0; $i<$ncols; $i++) {
printf("NASLOV KOLONE: [%s] = %s type[%d] = %s<lt><br><gt>",
$i, ora_columnname($curs, $i),
$i, ora_columntype($curs, $i));
}
printf("<b>SQL upit je: %s</b><br>",$query);
printf ("<br><table border=1>");
for ($j=0; $j<$real_rows; $j++)
{
printf("<tr>");
for ($i=0; $i<$ncols; $i++)
{
$col = ora_getcolumn($curs, $i);
printf("<td>. %s </td>",ora_getcolumn($curs, $i));
}
printf("</tr>");
ora_fetch($curs);
}
printf("</table>");
echo "<hr>KEWL ON ORACLE!!!";
?>
</PRE>