<?php 

include_once("function_pin_randome.php");
function pin_generate(){
	global $_conn_db;
	$generated_pin = get_rand_alphanumeric(8);
	
	$query_generate = mysqli_query($_conn_db,"select * from users where referral_code = '$generated_pin'");
	if(mysqli_num_rows($query_generate)>0){
		pin_generate('users');
	}
	else{
		return $generated_pin;
	}
};	
  $_generated_pin = pin_generate();	



?>
