SA-MP Forums Archive
Mysql (mysql_get_field) - 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 (mysql_get_field) (/showthread.php?tid=427167)



Mysql (mysql_get_field) - zT KiNgKoNg - 31.03.2013

I have a problem with mysql_get_field


pawn Код:
new result[32],result2[32],result3[32];
mysql_get_field("money", result);
mysql_get_field("job", result2);                   
mysql_get_field("admin", result3);                 
plInfo[playerid][pMoney] = strval(result);
plInfo[playerid][pStaff] = strval(result2);
GivePlayerMoney(playerid, plInfo[playerid][pMoney]);
Its not setting the value for the player if anyone can help me


Re: Mysql (mysql_get_field) - zT KiNgKoNg - 31.03.2013

Not fixed, the mysql data is not saving the plInfo[playerid][pStaff] (Was [pAdmin])


Re: Mysql (mysql_get_field) - Harti - 31.03.2013

We need more of your code to answer this properly.
Also, a little tip for you: Instead of creating three strings, use an array:

pawn Код:
new result[3][32];
result[0] = ... // result 1
result[1] = ... // result 2
result[2] = ... // result 3
result[3] is filled with the termination string, if you want to use it you have to extend the array. (More info: Wiki)


Re: Mysql (mysql_get_field) - zT KiNgKoNg - 31.03.2013

thanks i tried doing this but it didn't work and i fixed it sorry i didn't say