sql: The primary key of the data table is of varchar type and will not increase automatically. How to insert the primary key when inserting data
sql: The primary key of the data table is of varchar type and will not increase automatically. How to insert the primary key when inserting data
Why should the primary key be set to varchar type?
Maybe you have special needs! When inserting data, just like other fields, that’s it!
It means to use UUID, then you can use a program to generate UUID.
Then use uuid as the primary key
UUID as primary key insert
composer require ramsey/uuid
use RamseyUuidUuid;
$uuid1 = Uuid::uuid1();
echo $uuid1->toString()