Running a custom query alongside Drupal Registration Query Good afternoon all.
I would like to implement a custom query during the registration process of my registration. I've taken a look around online and can't find the information anywhere, so if anybody knows where the registration query is ran, so that I can add another query to it that would be awesome. Thanks in advance.
EDIT
The Query that runs alongside will go into a seperate game database, so alongside of the standard query it will also run 
This was my old query, so maybe it can help show what I'm trying to run.

  $server= "****";
    $user= "****";
    $pass= "****";
    $gamedb= "****";

$link = mysqli_connect("$server", "$user", "$pass", "$webdb") or die( "Error:" . mysqli_connect_error());
$username = mysqli_real_escape_string($link, (string) $_POST['username']);
$email = mysqli_real_escape_string($link, (string) $_POST['email']);
$password = sha1((string) $_POST['password']);
$query="INSERT INTO user (`username`, `email`, `password`, `permissions`)
VALUES ('$username', '$email', '$password', '1')";
mysqli_query($link, $query) or die ("Error:" . mysqli_errno($link));
mysqli_close($link);
The use of the hook_user_insert() it is call when the user is created. Here is an implementation example:

    function hook_user_insert(&amp;$edit, $account, $category) {
      db_insert('mytable')
        -&gt;fields(array(
        'myfield' =&gt; $edit['myfield'], 
        'uid' =&gt; $account-&gt;uid,
      ))
        -&gt;execute();
    }


Depending on your case you might want to check other hooks like:

hook_user_insert() 

hook_user_presave()

hook_user_update()