MySQL loading problem
#5

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.
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;
}
Reply


Messages In This Thread
MySQL loading problem - by SandKing94 - 16.05.2015, 07:47
Re: MySQL loading problem - by dominik523 - 16.05.2015, 08:02
Re: MySQL loading problem - by SandKing94 - 16.05.2015, 08:22
Re: MySQL loading problem - by SandKing94 - 16.05.2015, 08:53
Re: MySQL loading problem - by PowerPC603 - 16.05.2015, 09:01
Re: MySQL loading problem - by Konstantinos - 16.05.2015, 09:33
Re: MySQL loading problem - by SandKing94 - 16.05.2015, 09:44
Re: MySQL loading problem - by SandKing94 - 16.05.2015, 10:20
Re: MySQL loading problem - by rappy93 - 16.05.2015, 10:43
Re: MySQL loading problem - by SandKing94 - 16.05.2015, 10:46

Forum Jump:


Users browsing this thread: 2 Guest(s)