I'm inserting new users into tables users (using a webservice that insert), but how to make uid
being automatically inserted and it would be always the next value of the current maximal value on table users (and auto-increment too) ?
Thank you
I'm inserting new users into tables users (using a webservice that insert), but how to make Thank you |
||||
|
The The recommended way to add users is using the API ( Failing that, just query for the maximum ID in the table before you perform the insert; after the first insert, assuming you have exclusivity on this database while you're developing, you can maintain the increment in your code (no need to check the table each time). Drupal does exactly the same thing in
|
|||||||||||||||||||||
|
Use user_save() and try to avoid direct db_insert for new user creation. With direct db_insert you cut off the whole functionality of Drupal and other Modules |
|||
|
you can enter new user using user_save()
|
|||||
|