16.05.2015, 09:01
To load data from a threaded query, you need to specify a callback, with the playerid as parameter.
The cache is sent to that callback and you can read from it.
You should only use mysql_function_query without a callback when you send UPDATE or DELETE queries, as those don't return any data.
The cache is sent to that callback and you can read from it.
You should only use mysql_function_query without a callback when you send UPDATE or DELETE queries, as those don't return any data.
pawn Код:
format(query,sizeof(query),"SELECT * FROM players WHERE user = '%s LIMIT 1'",name(playerid));
mysql_function_query(conn,query,false,"LoadData","i", playerid);
forward LoadData(playerid);
public LoadData(playerid)
{
cache_get_field_content(0,"name",playerInfo[playerid][user],conn,128);
cache_get_field_content(0,"pass",playerInfo[playerid][pass],conn,128);
return 1;
}