mercredi 22 juin 2016

MySQL / PHP: random unique value for each row (like goo.gl)

I have a MySQL database with 1000 rows and increasing every day. They have a unique ID (auto-increment, from 1 to xxxx) but I want to give them a special, unique ID like www.goo.gl. So every record should have a value like:

MnjZR
r4Qfa
QW4xG

etc etc. They should all be unique, because I want to use them in my URL to load certain content, as in:

http://ift.tt/1rUfiW54fQdT

How will I be able to do this? I did some research but I was overwhelmed by different strategies and my programming knowledge is rather limited.

Thanks in advance!




Aucun commentaire:

Enregistrer un commentaire