Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Object of class CI_DB_odbc_driver could not be converted to string
#1

[eluser]souri84[/eluser]
hi guys !

I stop with oci and my OCI_COMMIT_ON_SUCCESS error, I decided to connect to Oracle through ODBC driver. it's more simple ! that's it ! I can to connect to my db. But I have other errors when I want to run a test SQL query.

I already seen this threadbut i don't understand........

here is my error log :

1:
Code:
A PHP Error was encountered

Severity: 4096

Message: Object of class CI_DB_odbc_driver could not be converted to string

Filename: models/test.php

Line Number: 12

2:
Code:
A PHP Error was encountered

Severity: Notice

Message: Object of class CI_DB_odbc_driver to string conversion

Filename: models/test.php

Line Number: 12

3:
Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined property: Reporting::$Object

Filename: core/Model.php

Line Number: 50

And it's my model :

Code:
<?php
class Test extends CI_Model
{
    function __construct()
    {
        parent::__construct();
    }
    
    public function conn_oracle()
    {
        $db_oracle= $this->load->database('oracle', TRUE);
        $identity = $this->$db_oracle->query('SELECT * FROM personne');
        
        $data = $identity->result();
        
        return $data;
    }

}
?>

What is my error ?

the line 12 is
Code:
$identity = $this->$db_oracle->query('SELECT * FROM personne');

Great Thanks !
#2

[eluser]danmontgomery[/eluser]
should be

Code:
$db_oracle->query();
not
Code:
$this->$db_oracle->query();
#3

[eluser]souri84[/eluser]
ok thanks, i will test it tomorrow...
#4

[eluser]souri84[/eluser]
grazie mille !!!!




Theme © iAndrew 2016 - Forum software by © MyBB