0

how can I let sql/mysql set the next id, that I have no problems with posts at the same time?

Jonas
  • 121,568
  • 97
  • 310
  • 388
user2693017
  • 1,750
  • 6
  • 24
  • 50

1 Answers1

0
CREATE TABLE Persons
(
ID int NOT NULL AUTO_INCREMENT,
LastName varchar(255) NOT NULL,
FirstName varchar(255)
)

Auto_Increment can be used as ID as there wont any duplicate value.
When insert value for the table :

INSERT INTO Persons (FirstName,LastName)
VALUES ('Hello','World')

The table will look like this.

ID | FirstName | LastName
1  |   Hello   |  World
chinna_82
  • 6,353
  • 17
  • 79
  • 134