Implementing disconnection in DboMysql

This commit is contained in:
José Lorenzo Rodríguez 2010-10-15 19:17:52 -04:30
parent 7a7659d063
commit 21f5707be7

View file

@ -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;
} }