October 24th, 2000, 03:11 AM
I have two tables, one with info about users, and one with gamestatistics. On one page I do four queries to these two tables and present it in four separate tables (ie table one - names and scored goals, sorted by goals desc; table two - names and played games, sorted by games desc ...).
I would like to run one query instead and fetch all the data needed, and then sort the array four times in different orders. Can this be done, and if so, how?
What's the most efficient way to do this, multiple queries or sorting an array?
October 24th, 2000, 04:23 AM
Use multiple queries, onless u make a database
connection to an entirely different computer with
a slow connection then u should use sorting yourself..
but mysql for example should sort much
October 24th, 2000, 04:49 AM
OK, I'll probably stick with multiple queries, using MySQLs order by, since the db is on the same computer. It's just that I read something about sorting arrays somewhere and got curious of how to do it.
October 24th, 2000, 06:00 AM
nice to hear a programmer spirit
experiment with sorting yourself,
like quicksort and bubblesort etc
it's very educational, and will make
u a better programmer