MySQL account issue
#4

Something like this: (Copied directly from rAdmin script)
pawn Код:
public MySQLCheckUserExistance(playerid)
{
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));

    format(query, sizeof(query), "SELECT `reg_id` FROM `users` WHERE `name` = '%s'", PlayerName);
    samp_mysql_query(query);
    samp_mysql_store_result();

    if(samp_mysql_num_rows() == 0)
    {
        return 0;
    }
    else
    {
      return 1;
    }
}
Usage:
pawn Код:
if(MySQLCheckUserExistance(playerid))
{
  //User is in the database (exists)
}
Reply


Messages In This Thread
MySQL account issue - by jamesb93 - 05.12.2009, 19:59
Re: MySQL account issue - by Grim_ - 05.12.2009, 21:17
Re: MySQL account issue - by jamesb93 - 05.12.2009, 21:25
Re: MySQL account issue - by Grim_ - 05.12.2009, 21:30
Re: MySQL account issue - by jamesb93 - 05.12.2009, 23:39
Re: MySQL account issue - by Grim_ - 05.12.2009, 23:44
Re: MySQL account issue - by jamesb93 - 06.12.2009, 00:11
Re: MySQL account issue - by jamesb93 - 06.12.2009, 08:58
Re: MySQL account issue - by Sergei - 06.12.2009, 09:06

Forum Jump:


Users browsing this thread: 1 Guest(s)