[eluser]haraldo[/eluser]
Hi there,
i'm currently opening a custom db connection within a hook. Recording a record and then closing the db. Something like below:
Code:
$this->_openDBConn();
// print_r( $this->oDB ) BEFORE
$this->recordVisit();
$this->_closeDBConn();
// print_r( $this->oDB ) AFTER
$this->recordVisit();
This works fine and the record is recorded in the db. No error etc.
However, i make another call to
Code:
$this->recordVisit();
immediatelty after i've closed the db connection. This record is also put in the db even though i've closed the connection correctly.
I know i'm closing it cause i can see i'm getting into the _close() function in the mysql driver. Also in the databse config i've set the following:
Code:
$db['default']['pconnect'] = FALSE;
When i print_r( $this->oDB ) before i get this (exert):
Code:
[pconnect] =>
[conn_id] => Resource id #58
after:
Code:
[pconnect] =>
[conn_id] =>
Why does the second record go in? I would expect to get a PHP error, no? Since the conn_id is empty.
Thanks for any advice.