PHP4.2.3 and Oracle 9.2
| From: | William Cheung | Date: | Thu, 15 Jan 2004 19:54:40 +0000 |
| Subject: | PHP4.2.3 and Oracle 9.2 | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-32424@lists.php.net to get a copy of this message | ||
I am using PHP 4.2.3 and Oracle 9.2. I have a test file that runs
successfully in command line. But when I use a browser to open the file, it
gives SQL error. Could anyone give me any insight what could be wrong?
Testora.php:
<?php
$conn_ptr = odbc_connect(“ORACLEDB”,”USERID”,”USERPASSWORD”);
print $conn_ptr.”\r\n”;
ob_flush();
$SQLReturn = odbc_exec($conn_ptr,”SELECT company_name FROM company”);
$ReturnRows = odbc_fetch_into($SQLReturn,$line,1);
while ($ReturnRows){
print $line[0].”\r\n”;
ob_flush();
$ReturnRows = odbc_fetch_into($SQLReturn,$line);
}
odbc_close($conn_ptr);
?>
Command line output:
Resource id #1
Company name list…
Error display on browser:
Warning: SQL error: Specified driver could not be loaded due to system error
5 (Oracle in OraHome92)., SQL state IM003 in SQL Connect in
c:\inetpub\wwwroot\PHP\testora.php on line 2.
Warning: odbc_exec(): Supplied argument is not a valid ODBC-Link resource in
c:\inetpub\wwwroot\PHP\testora.php on line 5
Warning: odbc_fetch_into(): Supplied argument is not a valid ODBC result
resource in c:\inetpub\wwwroot\PHP\testora.php on line 6
Warning: odbc_close(): Supplied argument is not a valid ODBC-Link resource
in c:\inetpub\wwwroot\PHP\testora.php on line 14
HYPERLINK "mailto:william@databyte.com"William Cheung
B.Sc, MCSE, MCDBA
HYPERLINK "http://www.databyte.com/"Databyte Corp.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.560 / Virus Database: 352 - Release Date: 1/08/2004