Function not work
#1

Hi, I made a function who search in players data base the phone nubmer, and make a random phone number,
and i made if any account have the random generated number, to repeat the function, but is not work, what is wrong with him?

HTML Code:
pc FindPhone()
{
//	new Cache:Result,Get[2], randomphonenumber = 1000000 + random(9999999);
	new Cache:Result,Get[2],randomphonenumber = 1 + random(2);
	Result = mysql_query(handle,"SELECT * FROM `players`");
	Get[0]= cache_num_rows();
	for(new x;x<Get[0];x++)
	{
		format(strings, sizeof(strings), "SELECT * FROM `players` WHERE `ID` = %d", x);//
    	Result = mysql_query(handle,strings);
    	cache_get_field_content(0, "PhoneNumber", temp), Get[1] = strval(temp);
	    printf("%d",Get[1]);
		if(randomphonenumber==Get[1])
		{
		    FindPhone();
		    return 1;
		}
	}
    printf("final %d %d",randomphonenumber);
   	cache_delete(Result);
	return 1;
}
In my database there are 3 account with numberphone 0 1 and 2, and the function should return 3 but not do it
I put one charcter to be simple to use
Reply


Messages In This Thread
Function not work - by Mister0 - 06.08.2016, 20:41
Re: Function not work - by Freaksken - 06.08.2016, 21:04
Re: Function not work - by Mister0 - 06.08.2016, 21:15
Re: Function not work - by Vince - 06.08.2016, 21:39
Re: Function not work - by Freaksken - 06.08.2016, 22:04
Re: Function not work - by Mister0 - 07.08.2016, 13:46

Forum Jump:


Users browsing this thread: 1 Guest(s)