IP address mysql.
#1

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

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.
Reply
#3

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);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)