/    Sign up×
Community /Pin to ProfileBookmark

problem connecting oracle10g express Edition using php

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 FilesApache GroupApache2htdocsoci8test.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”;

?>

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@mahiMay 09.2008 — Please try that by uncomennting php_oci8.dll in php.ini file. Thanks
×

Success!

Help @kdsutaria spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...