Inserting data to external DataBase i'm trying to insert data to a different data base that i created. I've read a lot in the forum, the support documents and other pages but i haven been able to figure it out the problem, can someone give me a hand? point me to a right direction?

first i modified the settings.php like this:

&lt;?php
/** ORIGINAL DATA BASE CONNECTION
$databases = array (
  'default' =&gt; 
  array (
    'default' =&gt; 
    array (
      'database' =&gt; 'dbname',
      'username' =&gt; 'dbuser',
      'password' =&gt; 'dbpsw',
      'host' =&gt; 'dbhost',
      'port' =&gt; '',
      'driver' =&gt; 'mysql',
      'prefix' =&gt; '',
    ),
  ),
);
*/

/** DOUBLE DATA BASE CONNECTION  */
$databases = array();
$databases['default']['default'] = array(
   'database' =&gt; 'dbname',
      'username' =&gt; 'dbuser',
      'password' =&gt; 'dbpsw',
      'host' =&gt; 'dbhost',
      'port' =&gt; '',
      'driver' =&gt; 'mysql',
      'prefix' =&gt; '',
);
$databases['civilproconstru']['default'] = array(
   'database' =&gt; 'name',
      'username' =&gt; 'username',
      'password' =&gt; 'password',
      'host' =&gt; 'datahost',
      'port' =&gt; '',
      'driver' =&gt; 'mysql',
      'prefix' =&gt; '',
);
?&gt;


And then in the module i'm creating i'm using this code: (i'm pasting the full module code, the insert is at the end, just in case the error is in the back)

&lt;?php
/** START CONFIG MODULE
 * Implements hook_permission().
 */
function project_creator_permission() {
  return array(
    'access project_creator content' =&gt; array(
      'title' =&gt; t('Access content for the project_creator module'),
    )
  );
}

 /**
 * Agrega a lista de estructura hook_block_info().
 */
function project_creator_block_info() {
  $blocks['project_creator'] = array(
    // The name that will appear in the block list.
    'info' =&gt; t('Project Creator'),
    // Default setting.
    'cache' =&gt; DRUPAL_CACHE_PER_ROLE,
  );
  return $blocks;
}

/**
 * Agrega menu en toolbar para "role" contratante hook_menu().
 */
function project_creator_menu() {
  $items['admin/crear_proyecto'] = array(
    'title' =&gt; 'Crear Proyecto',
    'description' =&gt; 'Crear Proyecto',
    'page callback' =&gt; 'drupal_get_form',
    'page arguments' =&gt; array('project_creator_insert'),
    'access callback' =&gt; 'project_creator_access',
  );

  return $items;
}


function project_creator_access() {
 global $user;
 if (in_array('contratante', array_values($user-&gt;roles))){
     return TRUE;
 }
}
 /**
 * END CONFIG MODULE.
 */

/** START PROJECT CREATOR FORM */

function project_creator_insert($form, &amp;$form_state){

    $form['p_name'] = array(
    '#type' =&gt; 'textfield',
    '#title' =&gt; 'p_name',
    '#size' =&gt; 15
    );

    $form['save'] = array(
    '#type' =&gt; 'submit',
    '#value' =&gt; 'save',
    '#submit' =&gt; array('project_creator_insert')
    );
    return $form;

db_set_active('civilproconstru'); /* OPEN DATA BASE*/
db_insert('project_info')
-&gt;fields(array(
'p_name' =&gt; $form_state['values']['p_name'],
))-&gt;execute();
drupal_set_message("succesfully saved");
db_set_active(); /*CLOSE DATA BASE*/

}
?&gt;


At the end, it shows me the form but when i click save button it seems to be inserting the data but when i check the database it still empty. It doesnt give me any kind of errors on execution.
Thank u for the help...
You don't have any submit callback. You should do any process with the submitted data in a submit callback like that:

function project_creator_insert_submit($form, &amp;$form_state) {
  db_set_active('civilproconstru'); /* OPEN DATA BASE*/
  db_insert('project_info')
    -&gt;fields(array(
      'p_name' =&gt; $form_state['values']['p_name'],
    ))-&gt;execute();
  drupal_set_message("succesfully saved");
  db_set_active(); /*CLOSE DATA BASE*/
}