Welcome Guest, Not a member yet? Register   Sign In
Difficulty connecting to Firebird by CodeIgniter
#1

[eluser]rocketroebr[/eluser]
I have problems connecting by String as vizualized in the documentation. I need for alternate runtime between different databases.
With MySQL, ok: mysql :/ / username: password @ hostname / database
But with FireBird: firebird ://user:password@host:/firebird/macrosystem2.gdb.
After generating the String make the connections:
Code:
$this->load->database('firebird ://user:password@host:/firebird/macrosystem2.gdb.', TRUE);
 It to the application. And worse, the server does not return error, help: Follow the documentation.
Documentation CodIgNiter, connection: http://ellislab.com/codeigniter/user-gui...cting.html.
Firebird Documentation plugin for codeigniter: https://github.com/cgarciagl/Firebird-for-Codeigniter
#2

[eluser]rocketroebr[/eluser]
(RESPOSTA EM PORTUGUÊS)
Eu resolvi, mas para aqueles que tiverem este problema segue a solução:
Se estiverem utilizando o Driver de conexão com o Firebird do link que passei anteriormente, faça o seguinte.
Abra o arquivo 'firebird_driver.php', vá até a função 'db_connect()' e faça a seguinte alteação:
ATUAL:
Code:
function db_connect() {
        $hoststring = $this->hostname . ':' . $this->database;
        $this->dialect."<br/>";
        return @ibase_connect($hoststring, $this->username, $this->password, $this->char_set, $this->dialect);
    }
MODIFICADO:
Code:
function db_connect() {
        $hoststring = $this->hostname . ':/' . $this->database;
$this->dialect."<br/>";
        return @ibase_connect($hoststring, $this->username, $this->password, $this->char_set, $this->dialect);
    }
Essa '/'(Barra), dependente do seu servidor pode ser exigida como concatenação da host string de conexão para com o banco de dados.
Por isso a modificação se faz necessária.
Arquivo 'firebird_driver.php' em anexo.

(RESPONSE English)
I solved, but for those who have this problem the solution follows:
If you are using the Driver connection with the Firebird passed the link above, do the following.
Open the file 'firebird_driver.php' go to 'function db_connect ()' and make the following change:
CURRENT:
Code:
function db_connect () {
         $ hoststring = $ this-> hostname. ':'. $ this-> database;
         $ this-> dialect. "<br/>";
         @ return ibase_connect ($ hoststring, $ this-> username, $ this-> password, $ this-> char_set, $ this-> dialect);
     }
MODIFIED:
Code:
function db_connect () {
         $ hoststring = $ this-> hostname. ':/'. $ this-> database;
$ this-> dialect. "<br/>";
         @ return ibase_connect ($ hoststring, $ this-> username, $ this-> password, $ this-> char_set, $ this-> dialect);
     }
This '/' (slash), dependent on your server may be required as a concatenation of host connection string for the database.
So the change is necessary.
File 'firebird_driver.php' attached.
#3

[eluser]rocketroebr[/eluser]
FIle 'firebird_driver.php'
#4

[eluser]rocketroebr[/eluser]
Talvez na função 'db_pconnect()' você terá que adicionar o '/' após o ':'. Faça testes.

Perhaps the function 'db_pconnect ()' you will have to add the '/' after the ':'. Experiment.
#5

[eluser]TheFuzzy0ne[/eluser]
Muito obrigado! Smile
#6

[eluser]Ademir Cristiano Gabardo[/eluser]
Thank you. This post helps me a lot...




Theme © iAndrew 2016 - Forum software by © MyBB