CodeIgniter Forums
[SOLVED] Object of class CI_DB_odbc_driver could not be converted to string - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: [SOLVED] Object of class CI_DB_odbc_driver could not be converted to string (/showthread.php?tid=41910)



[SOLVED] Object of class CI_DB_odbc_driver could not be converted to string - El Forum - 05-20-2011

[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 !


[SOLVED] Object of class CI_DB_odbc_driver could not be converted to string - El Forum - 05-20-2011

[eluser]danmontgomery[/eluser]
should be

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



[SOLVED] Object of class CI_DB_odbc_driver could not be converted to string - El Forum - 05-20-2011

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


[SOLVED] Object of class CI_DB_odbc_driver could not be converted to string - El Forum - 05-23-2011

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