title: last insert id issue in user table wordpress
body: <p>I have a registration form in my wordpress site. I used the following code to insert the user.</p>
  
  <pre><code>$username = $wpdb-&gt;escape(trim($_POST['txtFullName']));
  $email = $wpdb-&gt;escape(trim($_POST['txtEmail']));
  $password = $wpdb-&gt;escape(trim($_POST['txtPassword']));
  $confirmpassword = $wpdb-&gt;escape(trim($_POST['txtConfirmPassword']));
  $gender = $wpdb-&gt;escape(trim($_POST['gender']));
  
   $user_id = wp_insert_user( array ('user_pass' =&gt; apply_filters('pre_user_user_pass', $password), 'user_login' =&gt; apply_filters('pre_user_user_login', $username), 'user_email' =&gt; apply_filters('pre_user_user_email', $email), 'role' =&gt; 'author' ) );
  </code></pre>
  
  <p>I used the following code to get the inserted id under the above line.</p>
  
  <pre><code>$authid = $wpdb-&gt;insert_id;
  </code></pre>
  
  <p>AUTO_INCREMENT primary key in the user table varies from the inserted id. I couldn't track the error. How to fix this?</p>