how to get wordpress user id when user register

If wp_create_user executes successfully, it will return the id of the created user. [Codex]

Here it is in action with an error handler.

$user_id = wp_create_user();

if( is_wp_error($user_id) ) {
    echo $user_id->get_error_message();
} else {
    //add into custom table
    echo $user_id;
}

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)