I'm attempting to get my database to display all the data from the books table. When I activate node and open the server I don't get any errors but the table info isn't displayed either.
Any help would be amazing thanks
this is the code for the data to be displayed
<table>
<% for(var i=0; i < books_e.length; i++) { %>
<tr>
<td><%= books_e[i].book_name %></td>
</tr>
<% } %>
</table>
this is the route code
router.get('/', function(req, res, next) {
var connection = new MySql({
host: connection_details.host,
user: connection_details.user,
password: connection_details.password,
database: connection_details.database
});
var books_e = connection.query("SELECT * FROM books;");
res.render('books', { title: 'books', books_e:books_e });
});