Server Help

ASSS Questions - Alias - Ip

BDwinsAlt - Mon Nov 13, 2006 8:14 pm
Post subject: Alias - Ip
On the alias module that comes in ASSS, the ip is stored as an integer instead of the decimal form, how do I get it back into that decimal form in php? You might have seen my alias site that is linked the logic bot, well in logic bot the ip is stored as a plain ip. How can i convert this integer back into the decimal ip form? Thanks in advance.

Example: 192.168.1.104 = 3232235880
Mine GO BOOM - Mon Nov 13, 2006 8:31 pm
Post subject:
long2ip. Warning: depends on the byte order, so it may result in reverse numbering.
BDwinsAlt - Mon Nov 13, 2006 8:52 pm
Post subject:
Thank you so much. This worked.
Nice job on the fast response time. <3 icon_biggrin.gif
Smong - Tue Nov 14, 2006 5:23 am
Post subject:
If you look at the source to asss's alias module you can see there is a mysql function called inet_ntoa.
BDwinsAlt - Tue Nov 14, 2006 7:45 am
Post subject:
I did see that. I looked at it before I posted.
Cyan~Fire - Tue Nov 14, 2006 11:28 am
Post subject:
That's a mysql function? I think it's a networking (Winsock/whatever linux uses) function.
Dr Brain - Tue Nov 14, 2006 2:33 pm
Post subject:
http://dev.mysql.com/doc/refman/5.0/en/miscellaneous-functions.html

fourth and fifth functions from the top of the page.
BDwinsAlt - Tue Nov 14, 2006 5:02 pm
Post subject:
Nice, I thought it was a built in function in AS3 or something. I think it would be faster/better to just call the integer value from mysql then use long2ip. Calling the integer value, then calling the value of the integer in a decimal would mean putting a little more stress on the mysql server. I try to make everything load as fast and easy as possible.

If I notice the IPs not turning out right then I'll use the mysql function.

Thanks for helping me guys.

p.s. I know its not much for the sql server to do but I'm just picky about things.
Cyan~Fire - Wed Nov 15, 2006 11:30 am
Post subject:
Crazy. Why'd they put that in mysql too?
Mine GO BOOM - Wed Nov 15, 2006 2:30 pm
Post subject:
Because MySQL is usually a database behind an application running for multiple users. Since multiple users usually come from different locations, be it the Internet or on a LAN, IP storage is common. Since IPs are stored as numbers (4 bytes for IPv4, 16 bytes for IPv6), might as well support an easy to use interface for accessing those numbers. It is not like those couple of functions add much bloat.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group