Making auto increment User ID everytime i load Page

xaws555

Member
Joined
Jul 15, 2015
Messages
5
Programming Experience
Beginner
Sorry im pretty newbie here guys i wanna make a register form for my membership application
I wanna generate auto increment user ID when u load the page so that user ID won't be duplicate
Anyone can help
 
Generally speaking, the ID should be generated by the database, which is done when you save the record. You can then report the value to the user, if appropriate, after the registration is complete. Doing it any other way causes issues, e.g. if someone starts to register and then doesn't complete it or multiple people register at the same time.
 
So that means we generated when we insert into database? :)

That means that the database generates it when you insert into the database, just like I said in my previous post.
 
Exactly how you auto-generate an ID depends on the database. For SQL Server you would configure your PK column as an identity while for Access you would use an AutoNumber column. Some other databases use sequences that are generated independent of the table and then inserted by you.
 
Sir how about i want to make it with pattern? the lecture want me to make it pattern like this "wk-001"
If we generated it it will be an auto number right sir? Like 1,2,3,4,......
 
You can use two columns for that. Create one column that auto-generates an integer and then another column that generates its value using an expression based on the first column.
 
Back
Top