Update lib/database.php