php - generating unique id's instead of using mysql auto_increment for different tables

Solution:

There are two ways you could go about this.

The simplest and probably the best way being the MySQL uuid function. However, you could also use the last inserted id to generate a UUID, as long as it guarantees an ID that is actually unique, it is however very easy to get this wrong.

Answer

Solution:

A data that you create with a unique id in PHP can sometimes give the same output. The solution is in the link below. You can generate unique values.

https://www.php.net/manual/en/function.uniqid.php#120123

Source