Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

237
Views
¿Cómo puedo mostrar datos en mysql con nodejs y expressjs?

aplicación.js

 function showConnect(req, res){ mysql_crawl.query('SELECT full_price, discount_price, quantity, prod_link, images, prod_desc, status FROM `catalogsearch_fulltext` WHERE MATCH(data_index) AGAINST("ครีม") LIMIT 0 , 10', function(error, rows){ res.render('product.html',{related: rows}) })

producto.html

 <% for (var i of related){ %> <%= i %> <% } %>

resultado en producto.html

 [object Object] [object Object]

¿Cómo puedo mostrar todos los datos en product.html (full_price, discount_price, cantidad, prod_link, imágenes, prod_desc)

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

[object Object] es el resultado predeterminado de String. Lo que puede hacer es usar JSON.stringify() o indicar explícitamente lo que desea mostrar, como i.quantity, i.image, etc.

 <table> <% for(var i=0; i < related.length; i++) { %> <tr> <td><%= related[i].full_price %></td> <td><%= related[i].discount_price%></td> </tr> <% } %> </table>
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!