How to Add a Client-Side category based on MySQL results

From a MySQL database results, on the client-side I want to be able to add 1 additional category on the results table based on the database results.

Example: MySQL data “happy”, “glad”, “euphoric” become linked to a the client-side category of “Happiness.” MySQL data “sad”, “sadness”, “gloom” become linked to a the client-side category of “Depression.”

TABLE results example:

Mood State — Mood Category (client-side generated)


Happy - Happiness
Sad - Depression
Euphoric - Happiness
Glad - Happiness
Gloom - Depression

Any idea how I can code it?
I don’t want to mess with the MySQL database such as adding another column to the table.

Community Page
Last updated: