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 Quote Link to comment 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? Quote Link to comment 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]; Quote Link to comment 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: Quote Link to comment 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? Quote Link to comment 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? Quote Link to comment Share on other sites More sharing options...
Mchl Posted March 26, 2010 Share Posted March 26, 2010 VARBINARY or BLOB probably... Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.