Getting database info function