I have downloaded and installed the proper parts to use tabulator I got an example to show. Now I'm trying to pull data from my localhost database to use for a simple Ajax grid.
Here is the PHP code I'm using in a file called query.php
<?php
$db = new mysqli('localhost', 'root', 'PASS');
if ($db->connect_error) {
die("Connection failed: " . $db->connect_error);
}
$result = $db->query($db, "SELECT * FROM dataBase.table;");
if ($result) {
$to_encode = array();
while ($row = mysqli_fetch_assoc($result)) {
$to_encode[] = $row;
}
echo json_encode($to_encode);
}
And this is my HTML for index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Bitnami: Open Source. Simplified</title>
<link href="bitnami.css" media="all" rel="Stylesheet" type="text/css"/>
</head>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="jquery-ui.min.js"></script>
<script type="text/javascript" src="tabulator/dist/js/tabulator.min.js">
</script>
<div id="example-table">
<script type="text/javascript">
$.getJSON('query.php', function (data) {
var mydata = $.parseJSON(data);
$("#example-table").tabulator("setData", mydata);
});
</script>
</div>
</body>
</html>
For some reason, I'm getting a blank page let me know if you have any advice.