Display Data from MySQL


Hi, I have one MySQL table with two columns and about 20K rows. Column A contains duplicate values and Column B contains unique values.

Col A Col B

color red
color blue
color green
fruit orange
fruit apple

I was able to connect and display data successfully on my website. However, I want to be able to display one list of distinct values from Col A, click that value and display all Col B values associated across three columns. For example, I only want to see Col A values


Then when I select color… I want to see all values from Col B associated to color across three columns.

color red blue green

Does anyone know how to do this or could educate me to accomplish please?

Thank you,