Well, one simple way is to just use Jquery and AJAX. You lock the button to a load function. The load function loads an external PHP file which would be the query and stores the results in the DIV you pick for the results.
In Jquery, you just use something like: $(“buttonName”).click(function() to attach it to a button.
You can also attach the loading of an external file loosely something like this:
$(“buttonName”).click(function(){
$("#div1").load(“get_data.php”, function(responseTxt, statusTxt, xhr)
In the PHP file you would place your query to acquire the data and format the output of the query.
That way, when you press the button, it loads an external file into the DIV of your choice.
In CSS, you can have the data already loaded into a DIV and hide them and use CSS to show them when the button is pressed.
Or, you could make the page into a form and have it post back to itself and dynamically rebuild the
using parms passed back to the page. Pressing a button would call the page (itself) with an argument passed and retrieved using $_GET variables. Simpler to just use the JQuery/AJAX way, or CSS…
Lots of ways to handle this. Good luck!