Just a quick question we are discussing this at work, and bar using microtime to test information for a small query, we are no so wrapped up in proving one theroy and the other we are all bogged out.
What is quicker, (Here is a list of processes)
Click page
Pull information from SQL database (mySQL) with Where clause and ORDER BY
While (Repeat query based on sort type form user)
display informtion
End While.
OR
Click page
Pull information from SQL database (mySQL)
Populate Array
Use commands on Array for display. (Only query database once)
Now we know that the information is pulled once in the 2nd option, we know that the data can be out-of-date and we know that arrays are faster at searching.
Just in general we know it causes more load on the database with say 3 queries if the user wants to sort by $date DESC then $date by ASC then by $order_id.
Where as the array will only ever hit the database when coming to the page. (we know that more memory is used as more people with aarays being used)
Anyone shed some light ?