javascript - Displaying query result within Node.js Express -
i'm new node.js , express framework.
i wondering if there way display result of query mysql database within html file.
for example i'am establishing connection local mysql database, querying database , logging result.
var mysql = require('mysql'); var connection = mysql.createconnection({ host: 'localhost', user: 'root', password: 'password', database: 'applicants' }); connection.connect(); var id = 1; var query = connection.query('select * applicants id = ?', id, function(err, result) { console.log(result); });
i to, if possible, save result , display in html page. please me , tell me if possible or if going wrong way around it.
thanks
Comments
Post a Comment