V tomto routeru to podařilo zobrazit pouze konkrétní id, ale v rámci této id bych chtěl ukázat ostatním, že mám ve své databázi.
router.get('/detalles/:id', (req, res) => {
const id = req.params.id;
conexion.query('SELECT * FROM noticias WHERE id=?', [id], (error, results) => {
if (error) {
throw error;
} else {
res.render('detalles', { noticias: results[0], results: results });
}
});
});
V horní potřebuju jen detaily, specifické id, níže vám chci ukázat ostatním.