Switching between SQL Quarries

I know this is not the typical question that StackOverflow should handle but I need people’s ideas for this.

I’m currently learning PHP for web development and I’m working with SQL and a bit of data from my company (Confidential and I’m unable to show it). I have 2 different quarries currently written and I want to use a switch or a button (don’t know which is better) to switch between the 2 quarries in the back to display different data on the screen.

What are the best ways of doing this? I would be very appreciative if someone can give me a few code snippets on how to do this.

Thanks