PHP ORACLE Connection String

$db = "(DESCRIPTION=(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.34)(PORT = 1521)))(CONNECT_DATA=(SID=orcl)))" ;

if($c = OCILogon("system", "your database password", $db))
{
echo “Successfully connected to Oracle.\n”;
OCILogoff($c);
}
else
{
$err = OCIError();
echo “Connection failed.” . $err;
}

 

PHP provides Oracle OCI8 functions. Also other options are PDO with the Oracle Driver and (if oracle supports it) ODBC.

Leave a Reply

Your email address will not be published. Required fields are marked *