I’m trying to do something simple, but I have a hard time with arrays for some stupid reason. I have a “whosonline” page that I want to sort by distance. The distance ($distc) is a function that computes after the sql query. The query returns the user, photo, etc.
After the query, I have this:
Then it fills the table with the results…etc.<? } ?>[/php]
As it is, it returns the users ordered by the sql query. I would like for it to order from closest to farthest. How do I create an array(s) to sort the results?
Right now, I have it writing a temp mySQL table and filling it with the results, including the distance, then having a new query order by distance. That’s too much and I know there’s a simpler way.
Thanks for any input!