To communicate Oracle database with PHP is too easy process but this is different from MySQL database connectivity.
Here here is code to that connects oracle database with PHP
User,Password are required to connect with oracle. Also IP address Port and SID is required . These are credentials of the server where database is hosted.
<?php
$conn=”(DESCRIPTION=(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.82.131)(PORT = 1528)))(CONNECT_DATA=(SID=PROD)))”;
$conn = oci_connect(‘user’,’password.’, $conn);
if (!$conn) {
$e = oci_error();
trigger_error(htmlentities($e[‘message’], ENT_QUOTES), E_USER_ERROR);
}

Leave a Reply

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