How to order a set of results without re-querying the DB?
Posted: Thu Jun 29, 2006 5:07 am
I originally was asking questions about reversenatcase; but then silly me realised I could give myself the option of using the 'ORDER BY' capabilities of MySQL. (Don't worry though - I still need to reverse natcase thingy.)
What I want to do is parse a result from an sql query to a function.
Once I have $result; is there a way I can re-order this result?
OR would I be better off at re-querying the database using a new 'sort by' for when I want to sort by a different column of a table?? What I'm thinking is would (or COULD) a result end up being an extremely large object to parse around if I got hundreds of results in each query?
Would it rather be more efficient/'better programming' for me to re-query the database using a new 'order by'?
Thanks.
What I want to do is parse a result from an sql query to a function.
Once I have $result; is there a way I can re-order this result?
OR would I be better off at re-querying the database using a new 'sort by' for when I want to sort by a different column of a table?? What I'm thinking is would (or COULD) a result end up being an extremely large object to parse around if I got hundreds of results in each query?
Would it rather be more efficient/'better programming' for me to re-query the database using a new 'order by'?
Thanks.