Insert into table from Drupal 7
You don't need to actually override the login process to do this; The user module provides a hook (hook_user_insert()) which gets invoked any time a new user is created.

As far as inserting into the database goes, the best place to look first is the Database abstraction layer documentation which goes into detail about the various database methods available.

In this specific case it's the db_insert() function you're looking for. Your code might look something like this:

function MYMODULE_user_insert(&amp;$edit, $account, $category) {
  db_insert('custom_table_name')
    -&gt;fields(array(
      'id' =&gt; $account-&gt;uid,
      'text' =&gt; 'some text'
    ))
    -&gt;execute();
}


This code would go inside a custom module; if you're not familiar with creating one of those check out the Module developer's guide which will tell you everything you need to know.