Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Saturday, April 20, 2024
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  Sorting a VARCHAR ipaddress with INET_ATON

phpMyEdit General     Sorting a VARCHAR ipaddress with INET_ATON
Post new topic   Reply to topic    
 
Randy     Joined: 07 Apr 2006   Posts: 2  
Post Posted: 2006-04-07 21:00
Back to top  Reply with quote     

mySql has a function INET_ATON that converts a VARCHAR ip address field to a number. How can I use this function to sort my VARCHAR ip address field?

 
Randy     Joined: 07 Apr 2006   Posts: 2  
Post Posted: 2006-04-08 00:58
Back to top  Reply with quote     

This may not be p.c. but here is what I did:

In phpMyEdit.class.php add the following line:

if ($sort_field=='PMEtable0.ip') {
$sort_field = "INET_ATON($sort_field)";
}

right after:
$sort_field = $this->fqn($field);

Thank you open source.

Now the challenge is to find a better solution.

 
ajh     Joined: 17 Dec 2003   Posts: 236  
Post Posted: 2006-04-11 17:08
Back to top  Reply with quote     

Have a look at the 'sql' option...you could create a virtual field and then sort by it.

 
Post new topic   Reply to topic    

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy