I am working on a MySQL database. I am a TOTAL beginner. I have a form - a drop down list - and I want it to order by category immediately followed by any subcategories the primary category may have.
In my database, I have the primary links_cat. Inside links_cat are the id and sub_cat columns. If it is a primary field, it has a unique id assigned and '0' in the sub_cat column. If it is a subcategory, it is also assigned a unique id but in the sub_cat field, it shows the id of the primary category.
id sub_cat 1 0 2 0 3 1
so id #3 is actually a subcategory of id#1
In my drop down list, I would like for it to order the primary categories by 'id' but I want each subcategory to mmediately follow its primary category.
Thank you for your response. Yes, you got it. That is exactly what I want. I can't figure it out. And if you can help me, I will worship the ground you walk on! (well, and then I would have another question on how to get the front page which detects how many links are in a category to include in that total the links that are in the subcategories, but thats a question for another day)