adding constructor and functions in my database.php file