Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function newNumber($world)
- {
- $random = rand(100000,999999);
- $number = $random;
- do {
- $query = $this->db->query("SELECT id FROM accounts WHERE `id` = ".$number."", $this->getPrefix($world));
- if($query->numRows() != 0)
- {
- $number++;
- if($number > 999999)
- $number = 100000;
- if($number == $random)
- {
- return "Não existe um numero disponivel, contacte a equipe.";
- break;
- }
- $sucess = false;
- }
- else
- $sucess = true;
- } while(!$sucess);
- $this->data['id'] = $number;
- return $number;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement