IsUserNameAvailable doesn't work
#4

Try like this, but Im not expert in SQL yet

pawn Код:
stock IsUserNameAvailable(playername[])
{
    new esc[24],query[256];
    mysql_real_escape_string(playername,esc);
    format(query,sizeof(query),"SELECT COUNT(username) FROM `users` WHERE `username`='%s'",esc);
    mysql_query(query);
    mysql_store_result();
    if(mysql_fetch_int() > 0) { return 0; }
    else { return 1; }
}
Reply


Messages In This Thread
IsUserNameAvailable doesn't work - by BritishBoy - 06.04.2011, 15:15
Re: IsUserNameAvailable doesn't work - by BritishBoy - 06.04.2011, 21:51
Re: IsUserNameAvailable doesn't work - by Sergei - 06.04.2011, 22:00
Re: IsUserNameAvailable doesn't work - by Voldemort - 06.04.2011, 22:01
Re: IsUserNameAvailable doesn't work - by BritishBoy - 06.04.2011, 22:26
Respuesta: IsUserNameAvailable doesn't work - by anonymousx - 07.04.2011, 19:43
Re: IsUserNameAvailable doesn't work - by BritishBoy - 08.04.2011, 09:44

Forum Jump:


Users browsing this thread: 1 Guest(s)