$mycon=mysql_connect("localhost","ganesh","ganesh123"); mysql_select_db("kuber",$mycon); $ssaqry="select ssaname,ssacode from kuber where ssaname <>'CO'order by ssaname"; $ssars=mysql_query($ssaqry,$mycon); $ssars1=mysql_query($ssaqry,$mycon); $qry="select max(id)+1 mid from recovery_agent"; $rs=mysql_query($qry,$mycon); $mid=mysql_result($rs,0,"mid"); function random_generator($digits){ srand ((double) microtime() * 10000000); //Array of alphabets $input = array ("A", "B", "C", "D", "E","F","G","H","J","K","L","M","N","P","Q", "R","S","T","U","V","W","X","Y","Z","a", "b", "c", "d", "e","f","g","h","j","k","m","n","p","q", "r","s","t","u","v","w","x","y","z"); $random_generator="";// Initialize the string to store random numbers for($i=1;$i<$digits+1;$i++){ // Loop the number of times of required digits if(rand(1,2) == 1){// to decide the digit should be numeric or alphabet // Add one random alphabet $rand_index = array_rand($input); $random_generator .=$input[$rand_index]; // One char is added }else{ // Add one numeric digit between 1 and 10 $random_generator .=rand(1,8); // one number is added } // end of if else } // end of for loop return $random_generator; } // end of function $ranid= random_generator(8); //echo $ranid; ?>
Sorry last date is over
} ?>