Hello , i have a php project, i need to have a unique id number.
I generate a random number and then check if the number exists in db,
if it exists , i create another random number.
the problem is even sometimes the second generated number is also in database and is not unique.
So i need to run this code of generating a random number until its unique.
$query=$connnect_database->query("SELECT * from users where id='$id'");
$final_id = $id;
Bu iş için 25 freelancer ortalamada $7/saat teklif veriyor
Dear sir/madam, My self Aman I have more then 10 years of experience in Development. I have checked your posted Job Description as per my understanding we need to solve PHP website issues based on your job description Daha Fazla
We have just gone through the requirements and random number task sounds really interesting and We would love to work on it. We are the team of IT professionals, with experience of 6+ years in Web technologies/Mobile A Daha Fazla
The md5(uniqid()) function generates a unique ID based on the microtime (the current time in microseconds) solved with a coffee please
Hello, I have checked your code and I am having one solution for it. I will be looking forward to your positive response. Thanks!
Dear client. I think you can get unique id like below. $result=$connnect_database->query("SELECT MAX(id)+1 AS new_id FROM users"); $final_id=mysqli_fetch_object($result)->new_id; I want to discuss in more detail. Look Daha Fazla
Hello, This problem can be solved generating a Universally Unique ID (UUID) and also set the linked field in database as unique. I can help you solve the problem. Feel free to contact me on chat for details. Thanks.
Hi, I'll modify your code and it will generate a random number again again, until it will not unique. and the function will stop when it will generate a unique number. and unique number means when doesn't exists same n Daha Fazla
⭐ HELLO ⭐ ⭐⭐⭐⭐⭐⭐⭐⭐Hello, how are you?⭐⭐⭐⭐⭐⭐⭐⭐ Professional Web developer with 7 years and experienced with laravel, php, shopify, wordpress, web design, web development. I m ready right now and will make good job for y Daha Fazla
Hello, I am sure that I will give you good result about creatding unique and random number using PHP I build to your specs and also make sure to meet your time deadline. Any suggestion and recommendation will be welco Daha Fazla
Hello, I have read your description. I can help you to complete your code. We can create a recursive function to check id again and again unltil unique id is not genretated. Thank you. regards, Neeraj Agrawal