Auto increment in phpmyadmin

JaYwzx Wong picture JaYwzx Wong · Apr 14, 2011 · Viewed 433.4k times · Source

I have an existing database using PHP, MySQL and phpMyAdmin.

When users become a member on my website, I need the system to create a unique membership number for them using a five digit number. for e.g 83773. I guess it is like generating a random password except I only want numbers for my members. This ID number has to be unique to each member.

Would it be possible for me to set the primary key to auto_increment in my user table and set it to start at 10000 and then auto increment every time a member registers?

Also, is there a maximum number that the primary key ID number would go up to?

Is this a reliable and safe way to use the primary key ID number as a membership number?

Answer

Amit Bhagat picture Amit Bhagat · Sep 22, 2013

There are possible steps to enable auto increment for a column. I guess the phpMyAdmin version is 3.5.5 but not sure.

Click on Table > Structure tab > Under Action Click Primary (set as primary), click on Change on the pop-up window, scroll left and check A_I. Also make sure you have selected None for Defaultenter image description here