MySQL IP not saving correctly
#9

How did you insert the ip in your database ? if you insert it as 'int' change to `ip` varchar(16) NOT NULL

@ Originally Posted by [HRD]Mar1 View Post
Use GetPlayerIp(playerid, ip, 50); Directly

No that's wrong the ip can't exceed 16 letters. https://sampwiki.blast.hk/wiki/GetPlayerIp

EDIT:
pawn Code:
stock MySQL_Save(playerid) {
    new query[200],pIP[16];//query size too much and you check for small variables.
    format(query, sizeof(query), "UPDATE `playerdata` SET ip = '%s', adminlevel = '%d' WHERE username = '%s'",
    GetPlayerIp(playerid,pIP,16),
    PlayerData[playerid][pAdminLevel],
    GetPlayerNameEx(playerid));
    mysql_query(query);
    return 1;
}
Reply


Messages In This Thread
.... - by Ryan_Bowe - 25.12.2013, 19:14
Re: MySQL IP not saving correctly - by Aprezt - 25.12.2013, 19:18
Re: MySQL IP not saving correctly - by Ryan_Bowe - 25.12.2013, 19:19
Re : MySQL IP not saving correctly - by [HRD]Mar1 - 25.12.2013, 19:23
Re: MySQL IP not saving correctly - by Ryan_Bowe - 25.12.2013, 19:23
Re : Re: MySQL IP not saving correctly - by [HRD]Mar1 - 25.12.2013, 19:28
Re: Re : MySQL IP not saving correctly - by Ryan_Bowe - 25.12.2013, 19:30
Re : Re: Re : MySQL IP not saving correctly - by [HRD]Mar1 - 25.12.2013, 19:35
Re: MySQL IP not saving correctly - by SilentSoul - 25.12.2013, 19:37
Re: MySQL IP not saving correctly - by HardRock - 25.12.2013, 19:38
Re: MySQL IP not saving correctly - by Keyhead - 25.12.2013, 19:42
Re : Re: MySQL IP not saving correctly - by [HRD]Mar1 - 25.12.2013, 19:51
Re: MySQL IP not saving correctly - by SilentSoul - 25.12.2013, 19:56

Forum Jump:


Users browsing this thread: 1 Guest(s)