![]() |
| ||
| A mysql select question. I have a db full of articles that have a category field. Is there anyway to select and display just the different categories? |
| ||
| Re: A mysql select question. Sure... select distinct category from articles; |
| ||
| Re: A mysql select question. No, that's easy. What I am trying to do is make a list of the categories in the database without already knowing what is in it so oI can make a menu with links. |
| ||
| Re: A mysql select question. asuming your field is named catagory your SELECT command would look something like this: SELECT DISTINCT catagory FROM article_db ORDER BY catagory; This would go through the catagory field, select all the Unique entries so each catagory name only appears once, and displays them in alphabitical order. |
| ||
| Re: A mysql select question. Yea I noticed that other user up there was right too. Thanks! I figured it out!! |
| All times are GMT -4. The time now is 9:09 am. |
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC