I am having a scenario where I have to display a form and rather than taking input, I have to display some value extracted from database using nodejs. Below is the expected outcome
So, I wrote the following code
confirm.ejs
<form>
<label for="fname">First Name</label>
<input type="text" class="form-control" value="<%= ticket.Fname %>" id="fname" readonly>
</form>
js but I believe it is correct
router.get("/confirm",function(req,res){
db.query("SELECT * FROM details WHERE Ticket=?",[variabled4],function(err, results, fields){
if (err) throw err;
res.render('confirm', { title: 'ticket info', ticket: results});
});
});
So, I think the problem is in value = "<%= ticket.Fname %> and the whole form is displayed but with empty fields. (Fname is a column in details table with hello as value, not to be confused as a typo of fname)
Please suggest how to fix this.

HTMLInputElementbut I don't know how to use thatsequelizeRaw Queries should return an array as response. Check if you need to extract ticket from it ({ title: 'ticket info', ticket: results[0]}).