I want to check if a key exists in a MySQL DB. I can do this ok but I would need to create a new key if it does exist.
So this is the function that makes the key:
function keygen($a){
$b = str_shuffle('abcdefghijklmnopqrstuvwxyz1234567890');
return substr($b,0,$a);
}
So I thought about making a while loop to check if the key exists. But I don't know how to form it.
Could someone explain please. Thanks.