Oci_connect () will not use object properties as arguments

Parameters (private lines):

$this->username = 'app'; $this->password = 'passwd'; $this->service = '//local/DEV'; 

Does not work:

  $conn = oci_connect($this->username,$this->password,$this->service); 

Does it work:

  $conn = oci_connect('app','passwd','//local/DEV'); 

Why not oci_connect, as object properties as arguments? When using the properties of an object, I get an incorrect login error, but success when using strings. All this code is in the __construct () object.

+4
source share
2 answers

You have //localhost/DEV in the object, but //localhost/DEV in the lines, so they are not the same service.

+1
source

Have you tried using PDO to connect? I know that they did not approve the mysql_ extension, not sure about oracle.

http://www.php.net/manual/en/ref.pdo-oci.connection.php

with information:

 $dbc = new PDO('oci:dbname=local/DEV;charset=CL8MSWIN1251', 'app', 'passwd'); 
0
source

All Articles