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

204
Vistas
The ejs code does not give an output [EJS]

I have a problem. I'm writing a panel for my discord bot, I'm using ejs. The server is based on the express and passport library. The problem is that I want to display the name of the mysql database but I am not getting the result in the browser and with other results the result is displayed. Please help. I'm posting the code.

main.ejs

<%= server.guild_id %> <!-- 76593313568....704  -->

<% database.sql("SHOW DATABASES", 0, (rows) => { %>
   <%= rows[0].Database %> <!-- nothing -->
<% }) %> 

dashboard.js - route

const router = require('express').Router()
const database = require('./../database/database.js')

[...]

res.render('dashboard/server/main', {
    guilds: req.user.guilds,
    servers: rows,
    user: req.user,
    admin: false,
    points: 0,
    server: server,
    database: database
})

If I use the console.log code, I can see the database without any problems

about 4 years ago · Juan Pablo Isaza
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