Variable to Modal then Modal executes query

So, how should this be done:

I have a table that has a column with a button that will open a modal. In the modal I would like to execute another database query and then display the results. I don’t want to have the query run unless the modal has been displayed. Goal is to cut down connecting to the DB server. No need to query all of the additional data when the table is built if it will rarely be used.

Clear as mud.

Thanks for any input.

Community Page
Last updated: