How to get Connect with Oracle From PHP?
hi all,
pls explain how we can connect to Oracle from Php. I installed oracle on D drive. and tried the sample code from net...but i am getting the error
Fatal error: Call to undefined function: ocilogon() in C:\apache\htdocs\eg\oraconn.php on line 10
pls tell me do i need to do anything in the setting ?
sample code is
<HTML>
<HEAD><TITLE>Simple Oracle Example</TITLE></HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<B>Employees</B>
<BR><BR>
<?
putenv("ORACLE_HOME=D:\orant");
$connection = OCILogon("scott", "tiger", "192.5.2.51:1521");
$stmt = OCIParse($connection, "SELECT Empno,ename FROM emp");
OCIExecute($stmt);
// Start of table and column headings (ID and Name)
print "<TABLE CELLSPACING=\"0\" CELLPADDING=\"3\" BORDER=\"1\">\n";
print " <TR><TH>ID</TH><TH>Name</TH></TR>\n";
// Loop through results
while(OCIFetch($stmt))
{
print " <TR>\n";
print " <TD>" . OCIResult($stmt, "EMPNO") . "</TD>\n";
print " <TD>" . OCIResult($stmt, "ENAME") . "</TD>\n";
print " </TR>\n";
}
print "\n";
// As always, free the resources.
OCIFreeStatement($stmt);
OCILogoff($connection);
?>
thanx,
ckb