I need button to begin a mysql query to then insert the results into a javacript code block which is to be displayed on the same page that the button is on. mysql queries come f
Use AJAX,
example
$.ajax({ type: "POST", url: "yourpage.php", data: "{}", success: function(result) { if(result == "true") { // do stuff you need like populate your div $("#one").html(result); } else { alert("error"); } } });