SA-MP Forums Archive
MySQL question - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL question (/showthread.php?tid=355411)



[Resolved]MySQL question - iNoOx - 29.06.2012

Hi all,

So, i have a little problem ... i don't know how to get a value in a row for command...


Ex:

pawn Код:
new query[100],PName[MAX_PLAYER_NAME],Skin;
GetPlayerName(playerid,PName,sizeof(PName));
format(query,sizeof(query),"SELECT Skin FROM comptes WHERE Nom = '%s'",PName);
mysql_query(query);
mysql_store_result();
................ // Needed to remplace for get skin value
SetPlayerSkin(playerid,Skin);  // Value Skin get in query
mysql_free_result();

What can i write instead of the points.. ?

Thx lot for help

PS: I Use StrickenKid MySQL plugin

(Sorry for my bad english, i'm french :P)


Re: MySQL question - Shurik01 - 29.06.2012

PHP код:
new query[100],PName[MAX_PLAYER_NAME],tmp[16];
GetPlayerName(playerid,PName,sizeof(PName));
format(query,sizeof(query),"SELECT Skin FROM comptes WHERE Nom = '%s'",PName);
mysql_query(query);
mysql_store_result();
// Needed to remplace for get skin value
mysql_fetch_field("Skin"tmp);
SetPlayerSkin(playeridstrval(tmp));
mysql_free_result(); 



Re : MySQL question - iNoOx - 29.06.2012

Thaaaaanks a lot !!!