views:

16

answers:

1

Is there any function preserved to extract database configuration inside of my code, something like $db_user = drupal_get_dbuser(); $db_pass = drupal_get_dbpass();
...
...

+2  A: 

The code for this is:

<?php
  global $db_url;
  $creds =  parse_url($db_url);
  print $creds['user'];
  print $creds['pass'];
  var_dump($creds);
?>

More detailed info and edge-cases can be found by reading the code of http://api.drupal.org/api/function/db_connect/6

berkes
Great thanks a lot @berkes! )
sultan