Oracle's connectivity with PHP problem
Dear community memeber;
I am totaly new in php. I have no know much knowledge about it; please help me about connectivity with oracel 10g.
I have written script for connectivity as:
<?php
echo 'This is my first page.';
$db = "(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = BEQ-LOCAL.WORLD)))" ;
if ($c=OCI_NEW_CONNECT('pcs','pcs',$db)) {
echo “Successfully connected to Oracle.\n”;
OCILogoff($c);
} else {
$err = OCIError();
echo “Connection failed.” . $err[text];
}
?>
when I run it; I face the error:
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\xampp\htdocs\test.php on line 6.
and when I run this script:
<?php
$c = oci_new_connect('pcs', 'pcs', 'ORCL');
$s = oci_parse($c, 'select first_name from employee');
oci_execute($s);
while ($res = oci_fetch_array($s, OCI_ASSOC)) {
echo $res['FIRST_NAME'] . "<br>";
}
echo "This is a testing page.";
?>
Error shows:
Fatal error: Call to undefined function oci_new_connect() in C:\xampp\htdocs\ss.php on line 3
Please help me about connectivity.
Thanks in advance.
Shahab Ahmed Khan