PDA

View Full Version : problem when generating number


ajwar
28/08/2011, 06:18 PM
Why this code restarts server?

stock GeneratePhoneNumber(playerid)
{


PVar[playerid][pNumber] = 10000 + random(89999);
do
{
PVar[playerid][pNumber] = 10000 + random(89999);
new Query[300];
format(Query, sizeof(Query), "SELECT id FROM `playerinfo` WHERE `Number` = %i LIMIT 1", PVar[playerid][pNumber]);
mysql_query(Query); //Queries
mysql_store_result();

}
while mysql_num_rows() != 0;
mysql_free_result();
return 1;

}