PHP3를 이용한 오라클 연동 테스트입니다.
select * from emp
Warning: OCIResult: invalid column 0 in /home/http/htdocs/oracle.php3 on line 28
NULL 7369 SMITH CLERK 7902 17-DEC-80 800 NULL
Warning: OCIResult: invalid column 0 in /home/http/htdocs/oracle.php3 on line 28
NULL 7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300
Warning: OCIResult: invalid column 0 in /home/http/htdocs/oracle.php3 on line 28
NULL 7521 WARD SALESMAN 7698 22-FEB-81 1250 500
이렇게 주의라는 메세지가 납니다..
Warning: OCIResult: invalid column 0 in /home/http/htdocs/oracle.php3 on line 28
이 메세지좀 안나오게 해주세여
소스는 다음과 같습니다.
####################################
<center>
<br>
PHP3를 이용한 오라클 연동 테스트입니다.
<p>
</center>
<?php
putenv("ORACLE_SID=ORCL");
putenv("ORACLE_HOME=/home/oracle");
putenv("NLS_LANG=AMERICANy_AMERICA.KO16KSC5601");
putenv("ORA_NLS33=/home/oracle/ocommon/nls/admin/data");
putenv("TNS_ADMIN=/home/oracle/network/admin");
$handle = OCIPLogon("scott","tiger","ORCL") or die;
$query = "select * from emp";
$Parse = OCIParse($handle,$query) or die;
OCIexecute($Parse);
echo "<pre>\n";
echo "$query\n\n";
$numcols=0;
while (OCIFetch($Parse)) {
$numcols = OCINumcols($Parse);
for ($column=0; $column < $numcols; $column++) {
$data = OCIResult($Parse, $column); <===이부분이 잘못 됐나여?
if ($data == "") $data = "NULL";
echo "$data\t";
}
echo "\n";
}
$numrows = OCIRowCount($Parse);
echo "\nROWS RETURNED: $numrows\n";
echo "</pre>";
OCILogoff($handle);
?>
|