kdsutaria
02-01-2008, 12:37 PM
Hi!
I have installed oracle 10.2 express edition and php 5.2.5 and appache searver.
oracle standalone worknig fine. I am succeed to test php and appache server.
but when i am trying to connect oracle using php i am getting following error.
it says
Fatal error: Call to undefined function oci_connect() in C:\Program Files\Apache Group\Apache2\htdocs\oci8test.php on line
i hv run following script from oracle's website. I am new to php.
please help. I am struggling from 2 days.
<?php
$db_conn = oci_connect("hr", "1",
"//127.0.0.1/XE");
$cmdstr = "select last_name, salary from
employees";
$parsed = ociparse($db_conn, $cmdstr);
ociexecute($parsed);
$nrows = ocifetchstatement($parsed,
$results);
echo "<html><head><title>Oracle PHP
Test</title></head><body>";
echo "<center><h2>Oracle PHP
Test</h2><br>";
echo "<table border=1 cellspacing='0'
width='50%'>\n<tr>\n";
echo
"<td><b>Name</b></td>\n<td><b>Salary</b></td>
\n</tr>\n";
for ($i = 0; $i < $nrows; $i++ )
{
echo "<tr>\n";
echo "<td>" . $results["LAST_NAME"][$i]
. "</td>";
echo "<td>$ " .
number_format($results["SALARY"][$i], 2).
"</td>";
echo "</tr>\n";
}
echo "<tr><td colspan='2'> Number of
Rows: $nrows</td></tr></table>";
echo "<br><em>If you see data, then it
works!</em><br></center></body></html>\n";
?>
I have installed oracle 10.2 express edition and php 5.2.5 and appache searver.
oracle standalone worknig fine. I am succeed to test php and appache server.
but when i am trying to connect oracle using php i am getting following error.
it says
Fatal error: Call to undefined function oci_connect() in C:\Program Files\Apache Group\Apache2\htdocs\oci8test.php on line
i hv run following script from oracle's website. I am new to php.
please help. I am struggling from 2 days.
<?php
$db_conn = oci_connect("hr", "1",
"//127.0.0.1/XE");
$cmdstr = "select last_name, salary from
employees";
$parsed = ociparse($db_conn, $cmdstr);
ociexecute($parsed);
$nrows = ocifetchstatement($parsed,
$results);
echo "<html><head><title>Oracle PHP
Test</title></head><body>";
echo "<center><h2>Oracle PHP
Test</h2><br>";
echo "<table border=1 cellspacing='0'
width='50%'>\n<tr>\n";
echo
"<td><b>Name</b></td>\n<td><b>Salary</b></td>
\n</tr>\n";
for ($i = 0; $i < $nrows; $i++ )
{
echo "<tr>\n";
echo "<td>" . $results["LAST_NAME"][$i]
. "</td>";
echo "<td>$ " .
number_format($results["SALARY"][$i], 2).
"</td>";
echo "</tr>\n";
}
echo "<tr><td colspan='2'> Number of
Rows: $nrows</td></tr></table>";
echo "<br><em>If you see data, then it
works!</em><br></center></body></html>\n";
?>