Kapalı

quick project- to solve php issue uniqe id number.(code included)

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.

code below

$id=(rand(10001,99999));

$query=$connnect_database->query("SELECT * from users where id='$id'");

$find=mysqli_num_rows($query);

if($find==0){

$final_id = $id;

}else{

$final_id=(rand(10001,99999));

}

Beceriler: PHP, MySQL, Yazılım Mimarisi, JavaScript, HTML

Daha fazlasını gör: php field validation max number count, project playlist php clone, easy project onhtml php, employees tracking project system php, project management php mysql time free, simple project management php script, project control php, project management php, project mysql php, project manager php, php mysql order confirmation number, building online examination project using php, time project management php mysql, https www freelancer com buyers project upgrades php id 7169703&reg 1&ref ppp, fhttps www freelancer com buyers project upgrades php id 7864922&reg 1&ref ppp, search projects on freelancer by project id number, how to solve performance issue in php, airline reservation system project in php and mysql with source code

İşveren Hakkında:
( 2 değerlendirme ) Central, Hong Kong

Proje NO: #28586300

Bu iş için 25 freelancer ortalamada $7/saat teklif veriyor

(479 Değerlendirme)
8.6
Brightinfotech3

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

$7 USD / saat tutarından itibaren
(301 Değerlendirme)
7.6
gauravgargcs

Hi, I hope you are doing great..! I am highly interested in your job & would love to discuss your job details so we can understand everything better to deliver you the desired work. Please come over chat for further Daha Fazla

$8 USD / saat tutarından itibaren
(128 Değerlendirme)
7.3
sadgurusoft

Hello sir, My Name is Naresh and I'm currently working with Web Development and Web Design. and I have "5+ year of experience" in Web Development and Web Design. I'm ready to do this project work based on your Daha Fazla

$5 USD / saat tutarından itibaren
(177 Değerlendirme)
6.3
Eminencehub

Hey There After going through the details of your projects I understand that you need to have a unique id number. I believe that you are looking for a quality work which needs to be completed under a certain deadline. Daha Fazla

$10 USD / saat tutarından itibaren
(63 Değerlendirme)
5.9
shailsolanki

Hi, The Unique Id will generate using Recurring function in PHP. Please hire me and I will do the code. I am a web developer with more than 10 years of experience in HTML, CSS, PHP, Mysql, Javascript. Can we discuss mo Daha Fazla

$8 USD / saat tutarından itibaren
(21 Değerlendirme)
5.3
cherrystuart83

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

$7 USD / saat tutarından itibaren
(81 Değerlendirme)
5.3
engrasadozzaman

The md5(uniqid()) function generates a unique ID based on the microtime (the current time in microseconds) solved with a coffee please

$5 USD / saat tutarından itibaren
(11 Değerlendirme)
4.7
asifthebepotra

Hello, I have checked your code and I am having one solution for it. I will be looking forward to your positive response. Thanks!

$6 USD / saat tutarından itibaren
(4 Değerlendirme)
4.2
webdev1802

Hello, i can solve it. can we discuss more. I have 7 years of experience in web and mobile app development. I have developed many websites and mobile apps, I can share my previous work links. Can we have more discuss Daha Fazla

$8 USD / saat tutarından itibaren
(16 Değerlendirme)
4.6
artemkuznetsovv

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

$8 USD / saat tutarından itibaren
(3 Değerlendirme)
4.3
rahadkp50

Hi, I am confident about your project to solve PHP issue unique id number. I can easily fix this issue. I am the best person for this job. I would love to work with you and start this job right now and deliver this wit Daha Fazla

$7 USD / saat tutarından itibaren
(20 Değerlendirme)
4.2
celestialUK

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.

$8 USD / saat tutarından itibaren
(12 Değerlendirme)
4.2
YesAakash

✅I have worked on similar projects to what you are looking for, and I am confident I can exceed your expectations. I can complete your project on time and within your budget. My skill matching with your project require Daha Fazla

$5 USD / saat tutarından itibaren
(9 Değerlendirme)
4.0
jihadhasan7864

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

$15 USD / saat tutarından itibaren
(19 Değerlendirme)
3.4
alexeychaychenko

⭐ 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

$5 USD / saat tutarından itibaren
(10 Değerlendirme)
2.8
danyagrossmaster

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

$5 USD / saat tutarından itibaren
(4 Değerlendirme)
2.7
dpriye164

Dear Client, I hope you are doing well! I read out all the description and i clearly understood your project requirements. Thank you for this wonderfully opportunity. I would like to apply as a web developer in you Daha Fazla

$5 USD / saat tutarından itibaren
(3 Değerlendirme)
1.9
neeraj5051

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

$6 USD / saat tutarından itibaren
(3 Değerlendirme)
1.9
StecconsInc

Hi "I CAN START PROJECT RIGHT NOW" I have review your post carefully and interestly. You will be fascinated by my skills. i'd like to help and finish your project. So, I think that I can complete your project perfectly Daha Fazla

$8 USD / saat tutarından itibaren
(2 Değerlendirme)
1.4