Is there a way to sort results manually without having to build stupidly complex arrays?
I need to sort initially in a very specific way like so:
(then by A-Z)
Blah blah blah through to Z
Is it possible to do this even if I have to add the products in order manually?
I'm using PHP and MySQL.
OK, so just to let you know that I am getting something, but it's by no means right, but messing with the code does seem to alter the sort order:
ORDER BY DrinkType = 'Beer', DrinkType = 'Orange Juice', DrinkType = 'Apple Juice', DrinkType = 'Brandy', DrinkType = 'Carrot Juice', etc...
However, by presenting it in this manner, the results print backwards like so:
This is all very well, and I could change the order of the ORDER BY to be backwards so that it prints properly, but this isn't flexible and doesn't allow for new entries. Any new drink type NOT included prints before the specified sort order.
Does anybody have any thoughts on this?
I came across this extension of Tom Muck
I never used it myself.
I used other extensions of Tom Muck an they were OK.
How about creating a new column called 'sortfield'. Assign 'aaa' to Beer and 'aab' to Orange Juice. For the rest of the items populate it with the same value as DrinkType. You could create a trigger to do that for you. Then just sort on the sortfield.
Europe, Middle East and Africa