0

friends i want to create a array which contain no of unique key , it also need store in mysql database , which i have done on my wamp server but when i m running this code on web server online i getting that my page will hangup .......so please help me....
code

$no_of_pin=$_POST['no_pin'];
	$pin_cost=$_POST['pin_cost'];
	if(($no_of_pin!=null) && ($pin_cost!=null))
	{
		for($a=0;$a<$no_of_pin;)
		{
			$pin=mt_rand(1000000,9999999999);
			$qry=$obj->ex_query("select pin_id from uapl_pin where pin_id=$pin")or die();
			if($qry==1)
			{
				$a--;
			}
			else
			{ 
				$qry=$obj->ex_query("insert into uapl_pin values($pin,$pin_cost,'unused','$date','')")or die();
				if($qry>0)
				{
				   $prt_pin[$a]=$pin;
				   $a++;
				}
			}
			
		}
	}
	else
	{
		$mgs="Please Enter The value First.";
	}

plase help its urgent live project

3
Contributors
5
Replies
6
Views
6 Years
Discussion Span
Last Post by divyakrishnan
0

I think you has infinite loop iteration. echo your line 7 as

echo $pin=mt_rand(1000000,9999999999);

and check what happens?

0

your $qry in line 8 is always returns 1. that's why the iteration takes place and hanging up. Check that line

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.