[eluser]gmask[/eluser]
[quote author="LuckyFella73" date="1285598885"]There are multiple ways to do that. I don't know how flexible you
want you code, here just 2 approches:
You can just order your db results by category to group all links
of one category.
An other way would be to go through the loop (all results) and set
up some array-container and if-lines and push the rows into the
appropreate containers [array_push()]. Later on you can access your array where
you want. Can be handy but if your categories change its not the best
solution.[/quote]
The first solution isn't a solution at all, since I want to divide the list into completely different sets (I'd like each new category field encountered to start a new <ul>, with its own order method as defined by the database, and its own $category->title for further distinction).
I don't understand the second solution you suggested, so I will go and read the documentation on array_push() now, this may be the trick. But why would it be a problem if my categories change? Would links get lost? What I do right now when updating a category is first search the existing links for any that are contained in that category, and update them as well with the new category information, that way nothing slips between the cracks. If that's not what you meant could you explain your solution in more detail please?
Thanks for the suggestions!