Right. This is the approach I suggest:
Create the database table with an auto incrementing integer primary key.
Process the registration form and insert the user details, without specifying the key.
The database will then insert the row with an appropriate key for the user id.
Now, the problem is how to limit to 100 users. One approach is to check the number of rows in the database table when processing the registration, just before inserting the row into the database. A more robust approach is to create a constraint on the database table that limits it to 100 rows. You then attempt to insert the row, and then check for a constraint violation so as to report the error to the user.