Snijders, Mark wrote:

no the both sollutions won't work cause:

I can't sort within a query cause subnetaddr is a varchar ("")

so it will be ordere like this

and that's not good cause 60 is smaller as 100, so with the function
ip2long() i will first make an integer of it

the second array solution you gave, won't work, cause I need ALL the query results in the array, and that's the problem I can't handle....

if I would do it like you said, I can sort it, but then I have a sorted array and for each element I have to do a query again to get the other fields of the table, and that's not good (2500 rows)

so can please still somebody help me with this?

can you change the database format ?

store the address as four ints - then you can concatenate them when you need to, and sort as you wish

SELECT s_id, subnet_name, concat(subnetaddr1, '.', subnetaddr2, '.', subnetaddr3, '.', subnetaddr4) as subnetaddr ,subnetmask,dnsdomain, location, contact, ccn
FROM subnets
ORDER BY subnetaddr1, subnetaddr2, subnetaddr3, subnetaddr4;



-- PHP Database Mailing List ( To unsubscribe, visit:

Reply via email to