So here is my dilemma. I have a table that has 4 fields which are used for categorizing and sorting parts. There is a 7th field which acts as an identifier so it knows which rows to pull when the identifier is queried. The previous 4 fields are organized as such: there are two groups of 2, with one being the "title", or "header", and the other being the one to determine sorting within that group. The groups are as follows: Field1, aka, "Line", with a field for sorting Field3, aka, "Category", with a field for sorting Think of it like this: A "Line" of parts would be similar to saying "Fruit" The "Category(ies)" within would be like, "Apples", "Oranges", "Strawberries", etc. Here's an example: So, I need to know how to do this in PHP (or if it can be done in mySQL, and I'm just a dumbass). Also, all of these must remain in one table since they come from one excel file. I'm hoping I can get shown the right way! Thanks!