Fetching a data from mySQL
#1

Hello there!

I recently started working with mySQL querys. And I'm facing a problem. I need to fetch a data from my database (player's skin) but I don't know how exactly.

My player skin saves perfectly, and here is the code:
Код:
   new playerSkin = GetPlayerSkin(playerid);
    new query[70];
    mysql_format(g_SQL, query, sizeof query, "UPDATE `players` SET `skin` = %d WHERE `id` = %d LIMIT 1", playerSkin, Player[playerid][ID]);
    mysql_tquery(g_SQL, query);
I don't know what should I do to make it work, I tried adding a _tempskin to storage somewhere fetched data and later on I can set the skin but it returns CJ skin.
Код:
new query[70];
    new _tempskin;
    mysql_format(g_SQL, query, sizeof query, "SELECT FROM `players` WHERE `skin` = %d LIMIT 1", _tempskin);
    mysql_tquery(g_SQL, query);
    SetPlayerSkin(playerid, _tempskin);
Thanks!!
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: 2 Guest(s)