Reputation: 333
guys, how can i set the auto_increment of my userid something like this:
i want to start it in 200, then increment by 10 with a maximum value of 1000..
how will i code it using php?
please help me.. :-(
Upvotes: 1
Views: 135
Reputation: 449613
You can set a starting point to an auto increment value, but the rest you ask (increasing by 10, and limiting at 1000) is impossible on the mySQL level.
You would need to do this in your PHP code, as a pre-check before creating a new user account. Also, I would recommend doing this in a separate, indexed int
column.
Update: There is the auto_increment_increment
mySQL setting but it seems replication speficic, doesn't apply to your normal, single-database, myISAM setup, and is applied database-wide - it's not what you want.
Upvotes: 3