Fetching a data from mySQL
#6

You have to change query:

Код:
mysql_format(g_SQL, query, sizeof query, "SELECT FROM `players` WHERE `skin` = %d LIMIT 1", _tempskin);
Correct:

Код:
mysql_format(g_SQL, query, sizeof query, "SELECT skin FROM `players` WHERE `id` = %d LIMIT 1", Player[playerid][ID]);
After that, you can fetch like that:

Код:
if(cache_num_rows())
{
     cache_get_value_index_int(0, 0, _tempskin);
}
First 0 = row
Second 0 = column

Also you can't use mysql_tquery like that.
tquery = threaded queries, you have to make callback for them.

In your case use mysql_query (non threded query).
And read about cleaning cache in non threaded queries - https://sampwiki.blast.hk/wiki/MySQL/R40#mysql_query
Reply


Messages In This Thread
Fetching a data from mySQL - by Fratello - 27.09.2017, 14:37
Re: Fetching a data from mySQL - by AndreiWow - 27.09.2017, 14:48
Re: Fetching a data from mySQL - by jlalt - 27.09.2017, 14:50
Re: Fetching a data from mySQL - by Fratello - 27.09.2017, 14:56
Re: Fetching a data from mySQL - by jlalt - 27.09.2017, 15:00
Re: Fetching a data from mySQL - by raydx - 27.09.2017, 15:05
Re: Fetching a data from mySQL - by whadez - 27.09.2017, 15:21
Re: Fetching a data from mySQL - by Fratello - 27.09.2017, 16:24
Re: Fetching a data from mySQL - by oMa37 - 27.09.2017, 16:28
Re: Fetching a data from mySQL - by Fratello - 27.09.2017, 16:32

Forum Jump:


Users browsing this thread: 3 Guest(s)