SA-MP Forums Archive
A simple MySQL help - 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: A simple MySQL help (/showthread.php?tid=377378)



A simple MySQL help - Fernado - 14.09.2012

hello, i have a /setlevel id level command but i need the dini to mysql code
This is the function of saving level in dini

pawn Код:
dUserSetINT(PlayerName2(player1)).("level",(level));
                PlayerInfo[player1][Level] = level;
I just wanted to convert that to mysql.Please help me.


Re: A simple MySQL help - ReneG - 14.09.2012

I suggest you read up on MySQL. It's run in queries, not just one file function.


Re: A simple MySQL help - Roel - 14.09.2012

Код:
new query[128];
format(query,sizeof(query),"UPDATE `tablename` SET level='%d' WHERE username='%s'",PlayerInfo[player1][Level],PlayerName2(player1));
mysql_query(query);
Edit the 'tablename' to the name of your table. and also you need to have the level and username collum inside that table else it won't work.