SA-MP Forums Archive
IP address mysql. - 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: IP address mysql. (/showthread.php?tid=280824)



IP address mysql. - budelis - 03.09.2011

Hi all.I want to ask: how to save player ip in mysql?


Re: IP address mysql. - judothijs - 03.09.2011

First things first, you want to get the players ip:

pawn Код:
new ip[16];
GetPlayerIp(playerid, ip, sizeof(ip));
Then create a table in your MySQL Database and store it in there.


Re: IP address mysql. - Pinguinn - 03.09.2011

Change _ users _ to the table name you have

pawn Код:
new ip[16], query[256];
GetPlayerIp(playerid, ip, sizeof(ip));
format(query, sizeof query, "SELECT * FROM `users` WHERE ip= '%s'", ip);
mysql_query(query);