Ad

How To Know Laravel Connect With Oracle Oci8 And Select Statment Write

- 1 answer

Here is my Code in laravel with Oci8. i get this result

oci8 statement resource @364

. does anyone know what is issue? how to connect and use select statement.

$users = oci_connect('LE2', 'LE2', '(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.55.5)(PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = ORCL)))');
        if (!$users) {
            dd("no coonection");

          }else{
            $ss = oci_parse($users, "SELECT * FROM v_doctor_list");
            dd($ss);
          }
Ad

Answer

use yajra library to connect laravel to oracle you can use this code to test connection

if (DB::connection('your-connection-name')->getDatabaseName()) {
    echo "connected" 
}else{
 echo "not connected" 
}
Ad
source: stackoverflow.com
Ad