Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Streda, 25. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  Sorting a VARCHAR ipaddress with INET_ATON

phpMyEdit General     Sorting a VARCHAR ipaddress with INET_ATON
Odoslať novú tému   Odpovedať na tému    
 
Randy     Založený: 07.04.2006   Príspevky: 2  
Príspevok Zaslal: 2006-04-07 21:00
Návrat hore  Odpovedať s citátom     

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     Založený: 07.04.2006   Príspevky: 2  
Príspevok Zaslal: 2006-04-08 00:58
Návrat hore  Odpovedať s citátom     

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     Založený: 17.12.2003   Príspevky: 236  
Príspevok Zaslal: 2006-04-11 17:08
Návrat hore  Odpovedať s citátom     

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

 
Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov