Hi,
You mis-interpreting the meaning of GROUP BY. You said that you want the records to be 'grouped' like ...
Category one
Allie
Bilko
Jenny
Category two
Rufus
Wayne
Zach
... but the best you'll get is ...
| Category one | Allie |
| Category one | Bilko |
| Category one | Jenny |
| Category two | Rufus |
| Category two | Wayne |
| Category two | Zach |
... using ORDER BY only ...
$sql = "
SELECT *
FROM people
ORDER BY cisc_category ASC, last_name ASC
";
You usually want GROUP BY when you have aggregate functions in your SELECT clause (COUNT(), MAX() etc.)
Hope that helps.
Paul 🙂