Let's say I have a request to execute the following request:
Edit
The order is added because the real sql statement has one.
SELECT description, amount, id FROM table ORDER BY id
In this case, the identifier is not unique to the dataset. This will return something like this.
Description Amount ID ----------- ------ -- 1 Hats 45 1 2 Pants 16 1 3 Shoes 3 1 4 Dogs 5 2 5 Cats 6 2 6 Waffles 99 3
What I need to do is enclose each section of identifiers in its own div (so that lines 1,2,3 in one div, 4,5 in another div and 6 in it own div).
There are many solutions for this, but I just can't think of which is not too difficult.
I want to be able to store SQL like this and somehow sort the data set in PHP so that I can scroll through each section of the data set, making my way through the data set as a whole.
Some kind of array will work, but its structure forces me.
How can I make this work? PHP solutions will be an idea, but theoretical help will help too.
source share