This following is the data in my sql
i am trying to display the data individually into a html page in multiple table form. My expectation is the following
The NULL row need to exclude in the table.(ignore the caps)
<% availableItem.forEach(function(parameter1){ %>
<tr>
<td> <%= parameter1.Name %> </td>
<td><%= parameter1.ONE %></td>
<td><%= parameter1.TWO %></td>
<td><%= parameter1.THREE %></td>
<td><%= parameter1.FOUR %></td>
<% }) %>
here is my code in javascript
app.get("/display", function (req, res) {
// query database to get all the appliances
let sqlquery = "SELECT * FROM table";
// execute sql query
db.query(sqlquery, (err, result) => {
if (err) {
res.redirect("/");
}
res.render("display.html", { availableItem,: result });
});
});
Do i need to create a loop or something to do this? can anyone advice?