What should I do if phpmyadmin reports an error when setting the id primary key to auto-increment?
Beginners to PHP using phpmyadmin often encounter the problem of being unable to set the primary key to auto-increment when creating a table.
Only the sql statement can be used for help. In fact, it can be set in phpmyadmin. When modifying a field, drag it to the far right and you will see the auto-increment option.
Solution
LoginphpmyadminSelect a table in the database and select the structure.
Find the primary key that you want to set as auto-increment (if it has not been set yet, just click the key button).
Click [Modify].
In the row of field definitions displayed, drag the scroll bar of the browser to the far right to find the word A_I. This is the automatic value-added sign. Just tick it.
Click [Save], this time you will have an auto-incremented primary key.
The above is the detailed content of What should I do if phpmyadmin reports an error when setting the ID primary key to auto-increment?. For more information, please follow other related articles on the PHP Chinese website!