On your server, you need a PHP file/action doing something like:
$return = array();
$q = mysql_query('SELECT * FROM ...');
while(($return[] = mysql_fetch_assoc($q)) !== false);
echo json_encode($return);
In the pre-built HTML page, you'll need a container for the data to be printed:
<div id="db-container"></div>
Then the JS included in that page (I use jQuery here for simplicity and readability, though you can do it using native JS or probably any other JS tool):
function getDB() {
$.getJSON(
'http://url.to/your/code.php',
{},
function(data) {
var renderedHTML = '';
/* parse the object representing PHP's $return, mainKey will be numerical keys */
for(var mainKey in data) {
/* one main loop iteration == one table row */
renderedHTML += '<tr>'
/* data[mainKey] is a row in DB, subKey will contain a name of a DB table column */
/* data[mainKey][subKey] will therefore contain the value of DB table column 'subKey' for the DB table row numbered 'mainKey' */
for(var subKey in data[mainKey]) {
renderedHTML += '<td>' + data[mainKey][subKey] + '</td>'
}
/* statically add another HTML table column for the buttons */
renderedHTML += '
<td>
<input type="button" name="b1" onclick="func1(\'arg1\')">
<input type="button" name="b2" onclick="func2(\'arg2\')">
</td>
';
renderedHTML += '</tr>'
}
/* insert the built table into the page */
$('#db-container').html('<table>' + renderedHTML + '</table>');
}
);
}
Hope this helps.