mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
Implementing disconnection in DboMysql
This commit is contained in:
parent
7a7659d063
commit
21f5707be7
1 changed files with 4 additions and 3 deletions
|
@ -183,10 +183,11 @@ class DboMysql extends DboSource {
|
||||||
* @return boolean True if the database could be disconnected, else false
|
* @return boolean True if the database could be disconnected, else false
|
||||||
*/
|
*/
|
||||||
function disconnect() {
|
function disconnect() {
|
||||||
if (isset($this->results) && is_resource($this->results)) {
|
if (is_a($this->_result, 'PDOStatement')) {
|
||||||
mysql_free_result($this->results);
|
$this->_result->closeCursor();
|
||||||
}
|
}
|
||||||
$this->connected = !@mysql_close($this->connection);
|
unset($this->_connection);
|
||||||
|
$this->connected = false;
|
||||||
return !$this->connected;
|
return !$this->connected;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue