I need to pick up records from database and print them out in alphabetical fashion so it would show
‘#’ Records
- %@$ Records
- %$%^£@ Records
‘A’ Records
- A record
- A record
Hope that makes sense, I could do this via PHP but this would be rather complicated and would require a lot of code, is there a way to do this via DB and few lines of PHP?
This needs to pick up first letter of the entry, if its in alphabet, it would put it under correct letter, if its not, it would put it under ‘#’
This will take items in a given field and order them in a “descending” manner (i.e. alphabetical).
For grouping, look into creating PHP arrays. A sample would be something like this:
and from there you can use the PHP array. If something goes wrong with the sort, PHP does have sort array functions (one-line functions) which can fix such issues.