ip saving
#2

IP is (generally) a string, and must be handled as such. Not every sequence of numbers with dots is classified as a number. If you want to save the IP as a number (e.g. for easier use of the BETWEEN clause) then you can do so by using INET_ATON() and INET_NTOA().

Pawn implementation:
pawn Код:
inet_aton(ip[])
{
    new parts[4];
    sscanf(ip, "p<.>a<i>[4]", parts);
    return (parts[3] << 24 | parts[2] << 16 | parts[1] << 8 | parts[0]);
}
Reply


Messages In This Thread
ip saving( fixed it my self) - by JeaSon - 25.11.2014, 12:23
Re: ip saving - by Vince - 25.11.2014, 13:01
Re: ip saving - by JeaSon - 25.11.2014, 13:08
Re : ip saving - by Dutheil - 25.11.2014, 13:19
Re: ip saving - by OsteeN - 25.11.2014, 14:10
Re: Re : ip saving - by JeaSon - 25.11.2014, 16:11
Re: ip saving - by iZN - 25.11.2014, 16:41
Re: ip saving - by JeaSon - 25.11.2014, 16:50
Re: ip saving - by AnthonyTimmers - 25.11.2014, 22:59
Re: ip saving - by MD5 - 25.11.2014, 23:52

Forum Jump:


Users browsing this thread: 3 Guest(s)