In MySQL database I have 3 columns: Category, Name and Phone. Table looks like this example:
Work David 777444555
School Susan 776457333
Work Peter 743234556
Work Diana 765432456
Hockey Ben 786432567
School Tom 765434566
School John 765457865
etc...
So how to do a "tree" outcome with PHP from this table (sort from A to Z)? I need something like this example:
Hockej:
- Ben, 786432567
- etc.
School:
- John, 765457865
- Susan, 776457333
- Tom, 765434566
Work:
- David, 777444555
- Diana, 765432456
- Peter, 743234556