PDA

View Full Version : IP address mysql.


budelis
03/09/2011, 08:06 AM
Hi all.I want to ask: how to save player ip in mysql?

judothijs
03/09/2011, 09:34 AM
First things first, you want to get the players ip:


new ip[16];
GetPlayerIp(playerid, ip, sizeof(ip));


Then create a table in your MySQL Database and store it in there.

Pinguinn
03/09/2011, 10:01 AM
Change _ users _ to the table name you have


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