lundi 14 septembre 2015

How To Create An Auto Random Number Field In MySQL?

I'm working on a database for my website that needs to generate unique random 8 digit numbers as the primary key. I know its possible via PHP but if the generated number is currently in the database I need to do some additional calls. So I wanna prevent these calls to the database and reduce the website traffic. So I'm looking for something like what MS Access uses for the auto number data type. take a look at the properties table in these pictures:

enter image description here

And here is the results:

enter image description here




Aucun commentaire:

Enregistrer un commentaire