RE: [PHP] Sorting table columns dynamically on normalized MySQL tables [LONG]
| From: | Jay Blanchard | Date: | Wed, 20 Apr 2005 12:57:56 +0000 |
| Subject: | RE: [PHP] Sorting table columns dynamically on normalized MySQL tables [LONG] | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-213497@lists.php.net to get a copy of this message | ||
[snip]
Sorry that this has degenerated into a MySQL question rather than PHP.
I was originally looking for how people handled it in PHP.
---
Actually it didn't degenerate, it was a SQL question all along. Unless
you had a desire to build sortable arrays in PHP this type of sort
should always be done on the SQL side because it would be much more
efficient.
[/snip]
I also should have said that it the joins that allow you to maintain
normalized tables, for without joins you would be stuck with doing the
magic in the programming language. Since most DB engines are optimized
for handling joins leave that efficiency on that side of the equation.