Solution 1 :

If I understand your problem, you want to use the first button to get all the genres in the database and create a button for each genre, so :

1) Create a button with an onClick event that retrieves the genre field from your database as a JSON object.
Fetch API

2) With the query response, map the array, to create a array of buttons with the name of the genre as a title.
map function

3) In the previous loop, add an onClick event for each button to play your random songs.

The solution is in JS because you talk about Express.

Problem :

I have a question about html, can I create a button which can read the row (genre) in my database table and create new buttons with rock, hip-hop…?
Example -> button: Genre -> read database table: read genre row req -> (all genres) create for each genre one button.
When you click the new button you will get 4 random songs of this genre.
Hope you can help me.
I’m using Express.


Comment posted by

Please read the following article before posting a question.