Auto increment in phpmyadmin

前端 未结 9 2094
暗喜
暗喜 2020-11-28 05:19

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 the

9条回答
  •  攒了一身酷
    2020-11-28 05:35

    You cannot set a maximum value (other than choosing a datatype which cannot hold large numbers, but there are none that have the limit you're asking for). You can check that with LAST_INSERT_ID() after inserting to get the id of the newly created member, and if it is too big handle it in your application code (e.g., delete and reject the member).

    Why do you want an upper limit?

提交回复
热议问题