Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

191
Vistas
Database set up with js and ejs pages to allow for crud but select all statement isnt working

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 });
});
about 4 years ago · Santiago Gelvez
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda