web_master Posted March 26, 2010 Share Posted March 26, 2010 Hi, I found that I can coding the IP, in database looks like this: N"Ix or WaS� ... how can I do this, and after decoding? Thnx in advanced Link to comment https://forums.phpfreaks.com/topic/196625-coding-ip/ Share on other sites More sharing options...
Maq Posted March 26, 2010 Share Posted March 26, 2010 Hi, I found that I can coding the IP, in database looks like this: N"Ix or WaS� ... how can I do this, and after decoding? Thnx in advanced What are you trying to do exactly? Link to comment https://forums.phpfreaks.com/topic/196625-coding-ip/#findComment-1032349 Share on other sites More sharing options...
jonsjava Posted March 26, 2010 Share Posted March 26, 2010 I'm not sure what you are asking Are you asking how you can convert the IP into a long, so it's easier to sort in the database? $ip = $_SERVER['REMOTE_ADDR']; $long = ip2long[$ip]; Link to comment https://forums.phpfreaks.com/topic/196625-coding-ip/#findComment-1032350 Share on other sites More sharing options...
web_master Posted March 26, 2010 Author Share Posted March 26, 2010 In database IP is looks like this: Link to comment https://forums.phpfreaks.com/topic/196625-coding-ip/#findComment-1032385 Share on other sites More sharing options...
jskywalker Posted March 26, 2010 Share Posted March 26, 2010 that's not how it looks in the database, but that's how it looks in phpMyAdmin? Link to comment https://forums.phpfreaks.com/topic/196625-coding-ip/#findComment-1032407 Share on other sites More sharing options...
Maq Posted March 26, 2010 Share Posted March 26, 2010 Can you post the code that does the insert? What data type is the column "IP" in your DB? Link to comment https://forums.phpfreaks.com/topic/196625-coding-ip/#findComment-1032420 Share on other sites More sharing options...
Mchl Posted March 26, 2010 Share Posted March 26, 2010 VARBINARY or BLOB probably... Link to comment https://forums.phpfreaks.com/topic/196625-coding-ip/#findComment-1032452 Share on other sites More sharing options...
Maq Posted March 26, 2010 Share Posted March 26, 2010 OP, you should be using INET_ATOM and INET_NTOA when retrieving and inserting IP addresses. Link to comment https://forums.phpfreaks.com/topic/196625-coding-ip/#findComment-1032458 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.