MySQL data
#7

PHP код:
forward OnPlayerDataLoaded(playerid);
 
public 
OnPlayerConnect(playerid)
{
    new 
query[128], pname[MAX_PLAYER_NAME];
    
GetPlayerName(playeridpnameMAX_PLAYER_NAME);
    
mysql_format(MySQLquerysizeof(query), "SELECT * FROM `players` WHERE `Name` = '%e' LIMIT 1"pname);
    
mysql_pquery(MySQLquery"OnPlayerDataLoaded""d"playerid);
    return 
1;
}
 
public 
OnPlayerDataLoaded(playerid)
{
    
//Query processed, you can now execute cache functions (like cache_get_row) here.
    
new NumRows cache_num_rows();
    
printf("There are %d players with the same name."NumRows);
    return 
1;

Found this for you in the docs
https://sampwiki.blast.hk/wiki/MySQL/R33#mysql_pquery
Reply


Messages In This Thread
MySQL data - by Electrifying - 02.10.2018, 17:50
Re: MySQL data - by DAKYSKYE - 02.10.2018, 18:28
Re: MySQL data - by Calisthenics - 02.10.2018, 18:50
Re: MySQL data - by Electrifying - 02.10.2018, 18:53
Re: MySQL data - by Electrifying - 02.10.2018, 19:00
Re: MySQL data - by Electrifying - 02.10.2018, 20:43
Re: MySQL data - by NativeZ - 03.10.2018, 17:18

Forum Jump:


Users browsing this thread: 2 Guest(s)