Ip/mysql
#1

Ok, I have a issue with ips saving to a mysql database.

To get the player ip //This is at the top of my Saveaccount by all the other strings
pawn Код:
new playerip[16];
GetPlayerIp(playerid, playerip, sizeof(playerip));
My save account the part where it saves the ip, Public SaveAccount(playerid);
pawn Код:
format(string, sizeof(string), "UPDATE `players` SET `Carkey1` = '%d', `Carkey2` = '%d', `Carkey3` = '%d' , `Ip` = '%s' WHERE `id` = '%d'",PlayerInfo[playerid][pPcarkey], PlayerInfo[playerid][pPcarkey2],PlayerInfo[playerid][pPcarkey3],PlayerInfo[playerid][pID],playerip);
mysql_query(string);
When it goes to save to the data base it dosen't print the ip in the database it just shows a blank spot where the ip should be

Mysql Table Info
Код:
Field	Type	            Collation	    Null	Default	Extra
Ip	varchar(16)	latin1_swedish_ci    No      None
Top of my Saveaccount just incase it's needed
pawn Код:
forward SaveAccount(playerid);
public SaveAccount(playerid)
{
    new playerip[16];
    GetPlayerIp(playerid, playerip, sizeof(playerip));
    new string[255];
    if(PLogged[playerid] == 1)
    {
Does anyone have any idea why it's printing out a blank instead of the ip?
Reply
#2

As I can see it playerip and PlayerInfo[playerid][pID] should change place in your format code
Reply
#3

I had a feeling it was gonna be something simple, Makes me wonder why i didn't notice that in the firsy place, I'm a moron lol
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)