Forum : i want to connect oracle with php
Brief description  about Online courses   join in Online courses
View vikas  chaudhary 's Profile

i want to connect oracle with php

i want to connect oracle with php how i can?
Asked by vikas chaudhary | Mar 31, 2010 |  Reply now
Replies (2)
View teacher siliconindia 's Profile
Hi Vikas,

Use the oci_connect or oci_pconnect functions. You will need to have Oracle client software installed first.
Source(s):
http://ca2.php.net/manual/en/function.oci-connect.php
Apr 1, 2010
View teacher siliconindia 's Profile
Hi Vikas,

On Windows, edit your php.ini file and uncomment (remove the semi-colon) the following line:

extension = php_oci8.dll

Ensure that your "extension_dir" parameter (in php.ini) points to the location where the above extension file resides.

Using the OCI8 Extension Module -

<?php
if ($c = oci_connect("hr", "hr_password", "localhost/XE")) {
echo "Successfully connected to Oracle.";
oci_close($c);
} else {
$err = oci_error();
echo "Oracle Connect Error " . $err['text'];
}
?>

Note : You can just replace oci_connect(), instead of mysql_connect().
Apr 1, 2010