PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, December 5, 2022

[FIXED] How to know laravel connect with Oracle oci8 and select statment write

 December 05, 2022     laravel, oci8, oracle, yajra-datatable     No comments   

Issue

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);
          }

Solution

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" 
}


Answered By - waleedazam
Answer Checked By - Mary Flores (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing