What is the mysql query to add a user in Wordpress

What is the mysql query to add a user in Wordpress?

The fields I need to get populated are:
FirstName, LastName, UserName,Password, Email, Phone Number, City, Zip
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

INSERT INTO wp_users (user_login, user_pass, nicename, email, user_url, registered, display_name) VALUES ('username','userpass','nicename','email','user_url', 12/12/2011,'display_name')

Then to store the rest of the info you'll nead to look at that table and get the userid that was created then...

INSERT INTO wp_usermeta (user_id, meta_key, meta_value) VALUES (1,'Phone Number','number')

and keep doing an insert into that table for as many other pieces of info you want to keep on that user all in Name/Value pair for each row.

there are a few extra fields that i didn't include in the wp_user table but those are the main ones.  For a listing of the table structure check out...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
nainilAuthor Commented:

I use MD5 for the  password field. Will wordpress accept MD5 or does it need MD5 + Salt etc?
Why not use wp_insert_user()?


You could use wp_hash_password() to hash the password.  

[in pluggable.php]
function wp_hash_password($password) {
      global $wp_hasher;
      if ( empty($wp_hasher) ) {
          require_once ( ABSPATH . 'wp-includes/class-phpass.php');
          // By default, use the portable hash from phpass
          $wp_hasher = new PasswordHash(8, TRUE);
      return $wp_hasher->HashPassword($password);

If you want to see exactly what wp_hash_password() does, look in wp-includes/class-phpass.php

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.