1// Use https://github.com/JackChilds/jsmysqldb
2
3// Then once it's setup you can just do this:
4
5// Config that will be sent to server
6const config = {
7 "table" : "customers",
8 "limit" : "50",
9 "offset" : "0"
10};
11
12// Use the _POST_REQUEST function to send data to the server and get a response
13_POST_REQUEST("link-to-server/database.php", 'config=' + JSON.stringify(config), (response) => {
14 // Convert the response into an array of rows:
15 var data = JSON.parse(response);
16 // Now do what you want with data
17 // data[row index][column name]
18});