3 ms·
Use JavaScript to read MySQL database
- JackChilds 6y agoI have recently built this project that allows you to read sql databases on your server. It's easy to setup and use. Example of how to read table 'blog_posts' and output the first 100 into a table: const config = { "table" : "blog_posts", "limit" : "100", "offset" : "0" }; _POST_REQUEST("link-to-server/database.php", 'config=' + JSON.stringify(config), (response) => { document.querySelector('#myTableContainer').innerHTML = _json2table(JSON.parse(response)); }); See Github: https://github.com/JackChilds/jsmysqldb https://github.com/JackChilds/jsmysqldb