php - Setting the starting value of an AUTO_INCREMENT field in MySQL -


I have a simple question in creating a database in the database here my code is: "database" ( UIDID AT (5) AUTONCCCIMMENT, First Name (20), Last Name Writings (20), Usenet Naming (30), Password Varchar (32), Email varchar (50), age int (2), primary key Userid));

I need a USERID auto grant to start in a specific number example, starting with 99001. ...

I How can I do this?

You have two ways that a AUTO_INCREMENT field To set the starting price of if you already exist, you can call the following optional table command:

  Optional tab users AUTO_INCREMENT = 99001;  

Otherwise, you can set the starting start price in the CREATE TABLE command:

  create tab user (UIDID int (5) Faucet AUTO Isisiment, Prthamnam considered (20), Lastonam considered (20), Ughrneshn nomenclature (30), Password considered (32), email varchar (50), Age Int (2), primary (user ID)) AUTO_INCREMENT = 99001;  

Test case:

  create table user (UIDID int (5) tap AUTOCCCment, first name varchar (20), last name varchar (20) , Username varchar (30), password varchar (32), email varchar (50), age int (2), primary key (userid)); The query is fine, affected by 0 rows (0.04 seconds) Alternate table users AUTO_INCREMENT = 99001; The question is correct, insert the values ​​(0, 0.05 seconds) in the users (first name, last name, username, password) values ​​('A', 'B', 'C', 'D'); The query is OK, select 1 row (0.00 seconds) * from the users; + -------- + ----------- + ---------- + ---------- + ------ ---- + ------- + ------ + | User ID First name Last name | Username Password | Email | Age + -------- + ----------- + ---------- + ---------- + ------ ---- + ------- + ------ + | 99001 | One | B C. D | Faucet Faucet + -------- + ----------- + ---------- + ---------- + ------ Row (0.00 seconds) in the ---- + ------- + ------ + 1 set  

Comments