vendredi 11 janvier 2019

How to loop creation of unique Id to insert to database

I want to make sure that I create random strings to insert inside a mysql table .

The logic should go like thus:

(1)Create a random string and pass it to a variable(it may not be cryptographically secure)

(2)Check whether the random string already exists in he table

(3)If it doesn't exist,insert it into the table.If it does ,start from step (1) all over again.

I have an idea of how to do but not exactly how.

Please just give me an example




Aucun commentaire:

Enregistrer un commentaire