I used alasql and defined created table in node js, like this :
**app.listen(5556,'0.0.0.0', () => {
alasql("CREATE TABLE IF NOT EXISTS cart (ID INT AUTOINCREMENT, IDITEM INT,KODEBARANG STRING, NAMA STRING, QTY INT, PRICE INT, SUBTOTAL INT)");
alasql("CREATE TABLE IF NOT EXISTS tsuratjalan (ID INT AUTOINCREMENT, IDITEM INT,KODEBARANG STRING, NAMA STRING, QTY INT, PRICE INT, SUBTOTAL INT)");
alasql("CREATE TABLE IF NOT EXISTS tpenerimaanbarang (ID INT AUTOINCREMENT, IDITEM INT,KODEBARANG STRING, NAMA STRING, QTY INT, PRICE INT, SUBTOTAL INT)");
console.log('Server is running at port 5556');
});**
I already defined created table in index.js (server side) but when I tried to insert to this table with ajax on html, it said "Uncaught Table 'tsuratjalan' could not be found".
So table must be defined in one side (server) and only can be inserted from one side also ?