I need to connect to my database in php file in drupal 7. Each time I move from local server to development server, I have seen `setting.php` file which have array of database.

```
$databases = array (
  'default' => 
  array (
    'default' => 
    array (
      'database' => 'my_db',
      'username' => 'root',
      'password' => '',
      'host' => 'localhost',
      'port' => '',
      'driver' => 'mysql',
      'prefix' => '',
    ),
  ),
);

```

How do I aceess this database array in drupal 7 to use it connecting to database

```
$con = mysqli_connect('localhost','root','','my_db');

```

I am looking for drupal way to achieve this.

Thanks for Help