Retrieving data from a database, i would like to display the data on the website grouped by the Category value (a value stored in the database).
I began to write a separate table for each value of Category, but that's not really sensible since by that way there will be a hell of a lot of redudant code 🙁
There must be a way of changing the <TH> according to the value of the Category while dynamically creating the table, no?
Maybe some kind of iteration throu the Category, writing first one inside the <th> followed by the data whick belongs to the specific category, then on the next iteration the next Category will be printed out inside the <th> and the data belonging to this category and so on.
Have looked at several different codesnippets but nothing comes close to what i need!
Any suggestions??