Here's how I'd do it:
Radio button's onclick handler calls an ajax function. I really like the Prototype framework so I would use it to send the unique value of the radio button to the function that calls the php page (ajax) that runs the database query and returns a result. All that you should research and implement (I have provided plenty of links.) However, here comes a specific: Store the entire result set from the database in an array.
Assuming your PHP page for handling ajax calls is ajax.php, you might have:
<?php
$db = mysql_connect("localhost", "user", "pass");
mysql_select_db("database", $db);
$result = mysql_query("SELECT column1, column2 FROM table WHERE column3 = " . $_POST['radiobuttonid']);
$records = array();
while ($row = mysql_fetch_assoc($result)) {
$records[] = $row;
}
?>
The entire result set now "lives" in an array called $records. From there (in PHP5) you can convert the array to JSON using the PHP json_encode function.
Now you can echo it out in your ajax.php page. Which will in turn send it back to the ajax function or handler (see onSuccess option for Ajax.Request.)
For example, if you have a function defined to handle the output of the ajax call:
<script type="text/javascript">
var url = '/ajax.php';
var maketable = function (t) {
var records = eval(t.responseText);
}
new Ajax.Request(url, {
method: 'post',
postBody: 'radiobuttonid='+radiobuttonid,
onSuccess: maketable});
</script>
you can use the eval() function to turn your JSON encoded array into a javascript array (object really but you get the picture.)
Now, you can use javascript DOM functions to build the table dynamically. I'd use Builder from the scriptaculous library to create the html on the page.
This is vague because I can't spend all day writing code for you, but it should at least point you in the right direction. My way is more complicated than, say, having the radio button submit a form and handling the html rendering in php exclusively. If you can live with a re-post on the page for every radio button click, do so. If you want ajax to "paint" the contents on each radio button click (no re-post. more application-like) , you'll probably need to do it in a way similar to my method.