<p>Eric,</p><p>SELECT * from ip_whatever ORDER BY<br
/>substring_index(ip_address,'.',-3) ASC;</p><p>or</p><p>In PHP the string
function you are looking for is explode('.',ip_address) which will break the
value at its periods and place the results in an array ip[0] to ip[3] for
example.</p><p>Frank</p><p>Quoting Eric Benoit &lt;ebenoit@hopevale.com&gt;:<br
/><br />&gt; I know this is slightly off the topic of this list,<br />&gt;<br
/>&gt; but I know there are some programmers out there ;)<br />&gt;<br />&gt; I
have a column labled ip address, it is varchar, oddly enough I <br />&gt; input
...ip addresses in it. ha ha ha<br />&gt;<br />&gt; Here's my question:<br
/>&gt;<br />&gt; When I query the column and do an &quot;order by ip_address
ASC&quot; the <br />&gt; records won't ascend the way I want ex: 192.0.0.20,
192.0.0.112  and <br />&gt; so on<br />&gt;<br />&gt; instead they ascend this
way: 192.0.0.112, 192.0.0.20<br />&gt;<br />&gt; I am guessing this is because
ASC doesn't like the periods?<br />&gt;<br />&gt; A finger pointed in some
general direction would be great.<br />&gt;<br />&gt; Thanks,<br />&gt; Eric<br
/>&gt; _______________________________________________<br />&gt; nflug mailing
list<br />&gt; nflug@nflug.org<br />&gt; <a
href="/horde/services/go.php?url=http%3A%2F%2Fwww.nflug.org%2Fmailman%2Flistinfo%2Fnflug"
target="_blank">http://www.nflug.org/mailman/listinfo/nflug</a><br />&gt;<br
/></p>