listing links by category
Posted: Wed Jan 15, 2003 11:21 pm
Here's a problem I've recently run into. I am developing a "favorite links" section of a web site, and I want to somehow show links from a database by category. For instance, I might have a News category that lists CNN.com, MSN.com, and so forth, while also having a few other categories such as Politics and Technology all on the same page.
I have a good understanding of how to list links from a database, but I dont know how to list several links without printing out the respective category name more than once. So the problem i'm running into is that I would have to print out the category of News everytime I print out, say, CNN, MSN, and any new link under that category, so I end up getting needless repetition. Any ideas of how I can avoid this repetition of categories while still printing out all the links?
I have a good understanding of how to list links from a database, but I dont know how to list several links without printing out the respective category name more than once. So the problem i'm running into is that I would have to print out the category of News everytime I print out, say, CNN, MSN, and any new link under that category, so I end up getting needless repetition. Any ideas of how I can avoid this repetition of categories while still printing out all the links?