Hi all,
If i have my database setup as follows:
Database:
PAGE_ID - Autonumber
Page_NAME - text
SUBOF - Int
Data:
PAGE_ID: 1
PAGE_NAME: Index
SUBOF: 0
PAGE_ID: 2
PAGE_NAME: ANIMALS
SUBOF: 0
PAGE_ID: 3
PAGE_NAME: CATS
SUBOF: 2
PAGE_ID: 4
PAGE_NAME: DOGS
SUBOF: 2
PAGE_ID: 5
PAGE_NAME: PUPPIES
SUBOF: 4
PAGE_ID: 6
PAGE_NAME: SMALL ANIMALS
SUBOF: 2
And i want to output the following:
- Index
- ANIMALS
- CATS
- DOGS
- PUPPIES
- SMALL ANIMALS
Where PAGE_NAME is actually shown under the parent page -- how would i do this?
The only way i can think would be to SELECT * from database and do it with PHP.
Is there any way to get it the way i want with an mysql query?
Thanks for the help 🙂