mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +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
|
||||
*/
|
||||
function disconnect() {
|
||||
if (isset($this->results) && is_resource($this->results)) {
|
||||
mysql_free_result($this->results);
|
||||
if (is_a($this->_result, 'PDOStatement')) {
|
||||
$this->_result->closeCursor();
|
||||
}
|
||||
$this->connected = !@mysql_close($this->connection);
|
||||
unset($this->_connection);
|
||||
$this->connected = false;
|
||||
return !$this->connected;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue