Update database.php fixed multiple instances

Fixed the problem with using multiple instances and reusing them.
Update database.php
Update database.php
Update database.php
Merge pull request #75 from SecretD/patch-1

Update database.php fixed multiple instances