I would like to know how to generate in both PHP and SQL a unique random code for each user. This code will be used in the url of users' webpages.
For example, the website https://www.blablacar.fr/ uses the url https://www.blablacar.fr/user/show/random-unique-code-for-each-user to access to the profile of that user.
I think I should use uniqid
php function and store it in the database. But I don't know there is a better way to do so.
Thank you very much for your help.