Dynamic sorted A-Z Index with anchor links

I’ve got brain freeze again!

I want to do a dynamic A-Z Index of items (via a multiple records query) and simply organise by the initial letter of the title field. And to then have divider title block with A, B, C etc.

I am struggling as to where to go from here. Any help, guidance or sample code would be appreciated.

I can do the anchor links fine (red boxes)

This is what the MySQL 'library_title' field typically looks like

image

I can do a 'substr' to get the initial letter

SELECT	lib.library_id,
	lib.library_desc,
	lib.library_title,
    substr(lib.library_title,1,1) as alpha, 
	lib.library_text,
	lib.data_order,

I’d also like to do something like this with the A, B, C where the letters are bold if there is content under that heading

image

Community Page
Last updated: