Skip to content

Commit 57f0507

Browse files
committed
Update class.MySQL.php
Added a destructor, is needed in case of cleaning up permanent connections
1 parent 0531717 commit 57f0507

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

class.MySQL.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,13 @@ function __construct($database, $username, $password, $hostname='localhost', $po
5353
$this->Connect();
5454
}
5555

56+
/* *******************
57+
* Class Destructor *
58+
* *******************/
5659

60+
function __destruct(){
61+
$this->closeConnection();
62+
}
5763

5864
/* *******************
5965
* Private Functions *
@@ -375,4 +381,4 @@ public function closeConnection(){
375381
mysql_close($this->databaseLink);
376382
}
377383
}
378-
}
384+
}

0 commit comments

Comments
 (0)