01.08.2018, 05:03
What others simply meant was, Fire this query,
Then, inside the threaded function, check for number of rows affected.
If the number is not zero, it means the number already exists within some other player. In that case, return 0 to the function and re call the random value generation to do all this again until you find a random number.
Tip: You can save all new numbers inside a .ini file or something. Only numbers. When a player buys a new phone, get the values from that file and if none of them matches the number, assign it to new buyer.
Код:
SELECT pPhoneNumber from `users` where pPhoneNumber = RandNumber //or what ever your variables are.
Код:
cache_affected_rows()
Tip: You can save all new numbers inside a .ini file or something. Only numbers. When a player buys a new phone, get the values from that file and if none of them matches the number, assign it to new buyer.